|
From: <Ric...@i2...> - 2001-01-16 18:08:33
|
Hi, I've been playing with the new python.options.internalTablesImpl option. I'm noticing some oddities when I set this to "weak". Every once in a while I get the following error when I start up the Jython interpreter: Jython 2.0rc1 on java1.3.0_01 (JIT: null) error importing site Traceback (innermost last): File "/home/rseddon/pnp/3rdparty/jython/Lib/site.py", line 68, in ? File "/home/rseddon/pnp/3rdparty/jython/Lib/javaos.py", line 6, in ? NameError: OSError This doesn't happen very often, and I haven't found any way to reproduce it consistently. Is it possible that the table holding this is being garbage collected? I never see this error when I'm not using the weak table implementation. Also, it seems that the PyBeanEventProperty class is has a memory leak. Previously I had made a local patch to it, replacing it's HashMap's with WeakHasMaps. I verified that garbage collection was occurring by means of debugging print statements in the "finalize" method of some of my Java base classes. These same statements are never executed when using the new weak reference implementation. I can't see anything wrong with the new code, but it seems fairly certain that it isn't working When I switch back to my "WeakHashMap" patch I see that they are executed. Of course, it's difficult to _prove_ anything here, since I don't have much control over when garbage collection occurs. But things do look a bit suspicious. Has anyone else been trying out the weak reference implementation? Rich |