ok to the point, in jython-a0  I ran into the strangest behavior when I was developing jyleo.  I had a method that wrapped a position iterator with a java.util.Iterator.  This was all fine.  But when I wrote out a leo file the memory increased by 6%, each time!.  I could not fathom what was going on and had to instrument the jython implementation to get visibility.  What I found was somewhat startling, a new class was generated each time the method was called. 
so a seemingly harmless method/closure like this:
def example():
...class example_closure:
...return example_closure()
ended up eating up alot of memory.  For methods that get called alot this cant be used.  For those that called a little its ok.  But I must ask, does anyone think this is normal behavior?  We debated this on the Leo forums and Edward Ream pointed out that class is an executable statement, hence generating a new class each time was correct.   I still find myself debating the utility of such a mechanism, I find myself saying "Jython Closures Considered Harmful".
what say you Jython folks,
note: I would investigate this but wont have time for quite awhile to do the necessary digging... :(

Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search. Learn more.