Menu

#3 JDistro never releases memory

open-later
None
3
2005-10-03
2004-12-10
No

JDistro may have a huge memory problem. I'd run several
applications allocating much memory, e.g. ProjectX from
http://www.oozoon.de. I started it using Wharf once,
did some video editing and closed the application.
Simultaneously watched the memory consumption of
JDistros java process in a task manager (WinXP). After
completing my video task the memory consumption was
120MB. Then I did the same task once more and the
memory consumption was 172MB. And it stayed there even
if I wait for a long time.

BTW. ProjectX thows an VerifyError on launch, so I
started JDistro using the command below:
javaw -Xminf.1 -Xmaxf.2 -Xmx256M -noverify -cp
JDistro.jar
-Djava.system.class.loader=com.jdistro.JvmClassLoader
com.jdistro.jvm.JvmBoot

Furthermore I put some "magic" code into JvmBoot to
force GarbageCollection every minute:
Runnable cleaner=new Runnable() {
public void run() {
for(;;){
try {
Thread.sleep((long)(60000));
} catch (InterruptedException e) {}
System.gc();
}
}
};
cpt++;
Thread t1=new Thread(cleaner,"JDistro Background
Cleaner "+cpt);
t1.setDaemon(true);
t1.start();
This technique works good in many java applications if
object references are released by the programmer. In my
opinion this should be also the case if I close a
process in the JDistro container, so all application
data (except classes but also references stored in the
static variables) should be releasable by the garbage
collector.
I don't know how JDistro handles static variables
(yet), is it a class loader based approach or something
similar to Grzegorz Czajkowskis oopsla'00 paper
"Application Isolation in the Java™ Virtual Machine" (I
don't know where I found it)?

Helge

Discussion

  • Guillaume Desnoix

    • priority: 5 --> 3
    • assigned_to: nobody --> desnoix
    • status: open --> open-later
     
  • Guillaume Desnoix

    Logged In: YES
    user_id=26290

    Hi,
    Thank you for the bug report. I never wanted to close this
    bug (because how to be really sure that there is no memory
    leak?) but I may soon. JDistro uses a ClassLoader approach
    (and threads) and is implemented at the runtime level
    (java), not at the VM level (C) like the MVM. That said,
    there is 100% sure some memory leak when an application sets
    a static variable that is not yet managed. But how to manage
    such a variable really depends on its use: no single way.

     

Log in to post a comment.

MongoDB Logo MongoDB