Re: GlDrawableHelper allocates unecessary Iterator

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: GlDrawableHelper allocates unecessary Iterator

Sven Gothel
Administrator
On Tuesday, June 22, 2010 00:11:21 Taif [via jogamp] wrote:

>
> I've recently fallen love with the java allocation instrumenter
>
> http://code.google.com/p/java-allocation-instrumenter/
>
> Garbage collection can be a pain when you're trying to create visuals that
> run smooth as milk. The solution? Never allocate anything while the
> "visuals" are running (front load all the allocation).
>
> However, I'm being bugged by the fact that GLCanvas.display calls
> com.jogamp.opengl.impl.GlDrawableHelper's display method, which creates an
> AbstractIterator just to iterate an ArrayList.
>
> Of course, I'd fix this myself, but then I wouldn't have the nice
> signed-applet-certificates that you guys offer.
>
> Are all those iterators really necessary? Perhaps its some really subtle
> concurrency detail?
>
> Tl;Dr? com.jogamp.opengl.impl.GlDrawableHelper allocates an Iterator every
> frame - and I'm trying to reduce the allocation footprint of my opengl app.

Taif, you were completly right.

I have observed the same off behavior of megabytes of temporary object allocations,
mainly the Iterators.

Fixed with:

http://github.com/sgothel/jogl/commit/6ced17f0325d5719e992b246ffd156e5b39694b4
http://github.com/sgothel/jogl/commit/774138544e1eec3330309ad682fa05154a07ab8d#diff-99

Now we don't behave like a memory hog anymore, I hope :)

Sorry that it took so long, but I have missed this conversation for some reason.

Cheers, Sven
Reply | Threaded
Open this post in threaded view
|

Re: GlDrawableHelper allocates unecessary Iterator

gouessej
Administrator
Was the impact on memory really noticeable?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GlDrawableHelper allocates unecessary Iterator

gouessej
Administrator
Oups... You're right, I see a lot of memory allocation for StringBuffer instances in relationship with logs...
Julien Gouesse | Personal blog | Website