hello,
a few days ago i've profiled karga and let me share what i found about memory concerns:
unfortunately this code piece doesnt effectively retrieves heap back :/ Object3D has a package public field called myWorld referencing its world and world.removeAll() doesnt clear this field. so if you have a reference to any of the objects of your old world, that means you still hold a reference to your world :/
worse enough nulling all of your references to Object3D's and your world and callling System.gc() does not instantly retrieves heap back. if you carefully cleared all references, after some time jvm will correctly garbage collect your world but not instantly.
i suspect this is due to garbage collection mechanism: for instance if object A has a reference to object B, and object B has a reference to object A, and these two arent referenced by any other objects, jvm will eventually garbage collect the two. but i guess it takes some time for garbabe collector to detect the situation
btw, upcoming jPCT version (1.12) has an improved Mesh.compress() method which almost reduces memory requirements to half
it may help you a lot
you may also consider using java web start instead of applet. jws is much more flexible than applet and also allows setting max heap size even for untrusted applications
hope this helps
a few days ago i've profiled karga and let me share what i found about memory concerns:
Code Select
world.removeAll();
world = null;
unfortunately this code piece doesnt effectively retrieves heap back :/ Object3D has a package public field called myWorld referencing its world and world.removeAll() doesnt clear this field. so if you have a reference to any of the objects of your old world, that means you still hold a reference to your world :/
worse enough nulling all of your references to Object3D's and your world and callling System.gc() does not instantly retrieves heap back. if you carefully cleared all references, after some time jvm will correctly garbage collect your world but not instantly.
i suspect this is due to garbage collection mechanism: for instance if object A has a reference to object B, and object B has a reference to object A, and these two arent referenced by any other objects, jvm will eventually garbage collect the two. but i guess it takes some time for garbabe collector to detect the situation
btw, upcoming jPCT version (1.12) has an improved Mesh.compress() method which almost reduces memory requirements to half

you may also consider using java web start instead of applet. jws is much more flexible than applet and also allows setting max heap size even for untrusted applications
hope this helps
Code Select
r a f t