I've had some issues with running out of resources in conjunction with
manipulating BranchGroups and Shape3ds as well under J3D 1.2.

For context, the app I have is used for terrain visualization using a
quadtree
to determine which tiles are visible when compared to the view frustum.
This culling is performed whenever the view point changes, resulting in a
list of new terrain tiles to be added and removed from the scene graph.
Originally, I had a Branchgroup(BG) that I would modify each culling update
by
detaching it and adding and removing the terrain tile Shape3D children.
This
approach would grind to a halt after 10-30 seconds, even on a dual Pentium 3
w/ 512 MB
ram.  After trying different approaches, the solution that has worked well
is to have a BG for each Shape3D child, and to  add/detach this BG to the
parent BG, instead of
having one BG and adding/removing Shape3D children from it.  I monitored the
memory
usuage and was happy to see GC kicking in from time to time, whereas with
the original
approach it would zoom into the stratosphere.  You might be able to adapt
this for
your needs.  In my case, I've been able to shuffle large amount of terrain
data this way
for several hours at a time without having any memory problems.

Pedro Estrada
[EMAIL PROTECTED]

----- Original Message -----
From: "b. white" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 04, 2000 12:07 PM
Subject: [JAVA3D] java.lang.OutOfMemoryError.


>   Please don't suggest -Xmx or -Xmx this is not my problem
>
>     First Thanks Justin for letting me know that swing componets hog more
> memory than awt components, I haven't switched over yet to check this out
> for myslef but I will try it.  Someone posted that java 1.1 something had
> a garbage collection problem with shape3D's.  That sort of error would be
> consistant with the problems I am having. Does anyone know if this problem
> was really fixed for jdk 1.2.1? My program is used for a phsychology
> experiment so it displays many trials consecutively.  Each trial consists
> of a task in the j3d environment. I attatch one branchGroup and display it
> for the trial while creating the nextBranchGroup.  I then display the one
> that was just created, and remove the one that was just displayed.  I only
> ever have two Branchgroups.  So I believe that if the program runs through
> two trials it should be able to run through n trials.  However this is not
> the case I can only run about 13 trials.
>    I can run more trials using an -X switch but the program begins to slow
> down when I do this.  In any case, I shouldn't need to do this. The
> program runs and should never require more memory than it does during the
> first two trials.  If it is the case that jdk1.2.1 for windows NT has a
> problem garbage collecting shape3d's this would explain my problem. If
> this is the case is their a patch or workaround or something like
> that.  If this garbage collector error has been fixed are their other
> similar errors that could be causing my problem?
>
>    Thanks for any suggestions
>     Brian
>
> >  I submitted a few questions related to the java.lang.OutOfMemoryError a
> >few weeks ago.  I have now encountered it again in another app I am
> >designing.  I haven't yet been able to determine if this is a java/j3d
> >problem, or a mistake I am making in my code.  If anyone else has
> >encountered this problem please let me know what you did to solve it.  If
> >their is a bug filed for a memory leak related to creating, adding and
> >removing multiple  branchgroups please let me know.
>
> >   Thanks
> >   Brian
> >   [EMAIL PROTECTED]
>
>
===========================================================================
> 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".
>

===========================================================================
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".

Reply via email to