Hello,
some days ago I sent you this email (see bottom). I received a loot of
hints but there was nothing that could solve my problem. After 3 days of
unsuccessfull error serach I found out what leads to the enormous memory
leak in my application (sometime during 2 - 6 MB during 1 update action).
As you can see from the code I am setting my scene to not alive before
making some manipulations on the scene graph. However, the garbage
collector is not able to find the old instances that have been removed
during my manipulation - that means that several 1000 instances will not
be removed from the memory.
My last idea was to make all manipulations on a living tree. Now the gc
recognized that I have removed big parts of my scene and it removed
everything.
However I think it is not normal that this process will not work when
the scene in not alive! Java or better Java3d does not recognize that
something happens to the dead scene graph and all instances during this
action will become zombies and they can not removed anymore from the memory.
Is this a serious bug? What are you thinking?
With regards
Frank
Frank Oellien wrote:
> Hello ,
>
> I have a similar problem with my 3D application.
> I have an update method. During the update the scene will completly
> raranged. So I decided to add new branchgroups with the current content
> to the scene. I use a similar approach as described by Jon Barrilleaux
> in his 3DUI book.
> I can set my world to non live and than I overwrite my old variable with
> a new instance (see _glyphs = new GlyphWorld()). However, it seems that
> the old data will not disappear. With each update I will loose 6 - 12 MB
> memory and after some operations I got a OutOfMemory error.
> Deleting the locale or pushing the garbage collector has no influence.
> Any ideas?
>
> _world.setLive(false);
>
> int numChildren = objWorld.numChildren();
>
> // remove all existing childs from the scene
>
> for (int i = 0; i < numChildren; i++) {
>
> objWorld.removeChild(0);
>
> }
>
> _glyphs = new GlyphWorld();
>
> objWorld.addChild(_glyphs);
>
> _world.setLive(true);
>
>
> With reagards
>
> Frank Oellien
>
> Mehrtash Babadi wrote:
>
>> Dear members,
>>
>> Hi :)
>>
>> There's a while I've been developing a
>> non-commercial molecule modelling software
>> for java and I've used java3d API for the
>> rendering jobs by now. There is a nasty hole
>> in j3d and it is too annoying these days.
>> On each iteration, I detach and attach a temporary
>> BranchGroup to a parent group but it seems
>> that the old branchgroup doesn't get disposed
>> in anyways and the memory fills up in seconds.
>> So, I tried to devide that temporary branchgroup
>> into little branchgroups and update those sub
>> groups but when I create a live instance of the
>> temporary branchgroup, the subgroups only can add
>> and remove branchgroups, no transformgroup and ...
>> is accepted (I get sth like
>> AccessRestrictionException) I've played with the
>> capability bits enough and but it hasn't helped.
>> So, I tried to update the Shape3D's of the sub
>> groups... It worked but with a really poor
>> performace and screen shuffle ups!
>> Can I switch back to the old methods I mentioned
>> with a trick? or can I improve the performance
>> of Shape3D updates on display? (I tried to
>> stop the renderer on the update sequence but it
>> didn't work!)
>>
>> Any reply is too much appreciated!
>>
>> Sorry for the long mail,
>> Sincerely,
>> Mehrtash
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Yahoo! Sports - live college hoops coverage
>> http://sports.yahoo.com/
>>
>> ===========================================================================
>>
>> To unsubscribe, send email to [EMAIL PROTECTED] and include in
>> the body
>> of the message "signoff JAVA3D-INTEREST". For general help, send
>> email to
>> [EMAIL PROTECTED] and include in the body of the message "help".
>>
>>
>
> --
> Computer-Chemie-Centrum and Institute of Organic Chemistry
> University of Erlangen-Nuremberg
> Naegelsbachstrasse 25, D-91052 Erlangen (Germany)
> Tel (+49)-(0)9131-85-26579 Fax (+49)-(0)9131-85-26566
> email: [EMAIL PROTECTED]
> WWW : http://www2.chemie.uni-erlangen.de/oellien/
> http://www2.chemie.uni-erlangen.de/ChemVis/
>
> ===========================================================================
>
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JAVA3D-INTEREST". For general help, send
> email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
--
Computer-Chemie-Centrum and Institute of Organic Chemistry
University of Erlangen-Nuremberg
Naegelsbachstrasse 25, D-91052 Erlangen (Germany)
Tel (+49)-(0)9131-85-26579 Fax (+49)-(0)9131-85-26566
email: [EMAIL PROTECTED]
WWW : http://www2.chemie.uni-erlangen.de/oellien/
http://www2.chemie.uni-erlangen.de/ChemVis/
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".