logo       

Re: problem memory with memory management: msg#00016

lang.jython.user

Subject: Re: problem memory with memory management

[ Carlos Garcia ]

> I have a memory leak in an application that uses the Python.exec()
> method multiple times,
> i can see in jprobe that instance of classes org.python.pycode._pyx*
> and
> org.python.proxies.* dynamically created during an exec are not
> cleaned by the
> garbage collector, i can see in jprobre that there is a static member
> of otsself that
> do not allow the garbage colector to clean it
>
> Any idea about what can i do?


Hi Carlos,

try using weak references for internal tables, e.g. in the registry
file:

# List of choices for internal tables impl (PyJavaClasses canonical map
etc.),
# these are separated through ':' and tryed from left to right.
# For long running applications under java2, needing classes unloading,
# in order to have jython runtime automatically discarding
# no longer needed info and avoding memory leakage, this can be set
# to weak or soft (=> an impl. using weak-refs or soft-refs will be
used).
#python.options.internalTablesImpl = soft
python.options.internalTablesImpl = weak

In my case, weak solved a memory leak, while soft was no help.

Best wishes,
Oti.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise