Re: Memory leak caused by JavaNew[...] (JLink package)
- To: mathgroup at smc.vnet.net
- Subject: [mg96329] Re: Memory leak caused by JavaNew[...] (JLink package)
- From: dh <dh at metrohm.com>
- Date: Wed, 11 Feb 2009 05:25:11 -0500 (EST)
- References: <gmrluq$9hq$1@smc.vnet.net>
Hi Andrew, did you forget to realease the Java object you create? Daniel Andrey wrote: > Hello, > > I have a function like this: > > myFun[...]:=Module[{...}, > ... > outputDataPacketObject = JavaNew["mypackage.MyOutputClass", ...]; > > (* run some calculation and result result within > 'outputDataPacketObject' java object *) > result = MyCalcObject at runSimpleCalculation[... > outputDataPacketObject ... ]; > > ]; > > The function should be called many times (>3000). > > It turnes out that something in the program eats the memory and after > sometime the kernel says "no enough memory". > > So, why it might happen? What might be wrong? Is there a way to clear > the memory? > > > Regards, > > -Andrey >