Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java3D & garbage collection  (Read 1500 times)
0 Members and 1 Guest are viewing this topic.
Offline The_Wyvern

Junior Newbie




Java games rock!


« Posted 2003-02-15 20:46:43 »

Hello!
I'm developing an Italian Poker game in Java3D.
I'm new in Java2 and Java3D programming and I'm experiencing problems with memory.

In the game I build a SimpleUniverse with several BranchGroups which can be detached at runtime, each containing a lot of TransformGroups.
There's also a dedicated BranchGroup for Behaviors.
Each detached Branchgroup is eliminated immediately, calling the gc.

myDetachedBG = null;
System.runFinalization();
System.gc();

At the end of the game, I call

mySimpleUniverse.removeAllLocales();
System.runFinalization();
System.gc();

to free memory and start a new game.
Unfortunately only a small amount of memory is collected, and when I start the game again it begins to grow.
I don't think it's a problem of circular reference.

Can you help me?
Thanx and excuse me if my English is not so good.
Giuseppe
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #1 - Posted 2003-02-16 06:30:29 »

You are not alone.

AFAIK there are known memory leaks and probably unknown ones. We experience the same where the leaks seems to be somewhere around TriangleStripArray. Unfortunately, this is for our terrain so the leak is really big (~10MB). But I've not been able to isolate it. Maybe you can?

Currently there's a Java3D beta on the way, so it would be cool if such leaks could be eliminated before RC.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline The_Wyvern

Junior Newbie




Java games rock!


« Reply #2 - Posted 2003-02-18 12:04:48 »

Unfortunately I wasn't able to isolate the leak. I'm wondering if the problem is about BranchGroup detaching.
In fact I used to remove some animations by detaching their parent bg, and then I used to null-sign them to make them eligible for gc.
Maybe Java GC can't handle detached complex SceneGraphs?
As I told you I'm new in Java programming, and probably I'm wrong.
But I don't think Sun's  Vanilla GC is as smart as they say!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline vrm

Junior Member




where I should sign ?


« Reply #3 - Posted 2003-02-18 12:49:45 »

tryed with :
   -Xincgc           enable incremental garbage collection
 Huh
Offline The_Wyvern

Junior Newbie




Java games rock!


« Reply #4 - Posted 2003-02-19 11:22:08 »

I executed my program with the incremental GC on, but I got only little benefits.
I tried also to execute with "java verbose:gc ..." on and noticed leaks of 10-15 mb every time I rebuild my SceneGraph. Memory usage grows until java.lang.OutOfMemory!!!!
Yesterday I searched a lot and I found some evidence about leaks in :

 javax.media.j3d.Transform3D.<init>(Transform3D.java:87)
       
javax.media.j3d.SceneGraphPath.<init>(SceneGraphPath.java:61)
       

javax.media.j3d.Picking.getSceneGraphPath(Picking.java:362)
       

javax.media.j3d.Picking.pickAllSorted(Picking.java:88)
       
javax.media.j3d.Locale.pickAllSorted(Locale.java:599)
       
rob.kit.KitUtilities.pick(KitUtilities.java:64)

What do you think about these?
Oh...by the way. I use jdk1.4.1 and java3D1.3.1OGL
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #5 - Posted 2003-02-19 12:03:19 »

There is a current discussion on memory leaks in the context of picking on the Java3D mailing list.
I didn't follow the discussion so I don't know any details.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (15 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (33 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (29 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (42 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!