[mapguide-users] Memory Leak in Java
riccardo.pucci at geowebitalia.it
Thu Dec 19 04:11:04 PST 2019
Your hint is helpful: I tried with a smaller buffer (1024) and the leak is
greatly reduced so the dimension of buffer is somehow involved. Still the
leak remain. There is some memory allocated by c++ that is not freed. That
memory is off of the java heap, so it cannot be directly managed by garbage
Il giorno mer 18 dic 2019 alle ore 21:50 Benoit Begin <bbegin at geomapgis.ca>
> I'm no Java expert, but I feel it could be a similar issue that you may
> with .NET and Large Heap Objects. With the size of the byte array you are
> creating, 1024x1024, you might be overruning the size of the level 1
> generation for the Garbage Collector and end up putting your data in a
> generation that doesn't get collected very often.
> So when I do things in .NET with MgReaders that can get sizeable, I do set
> hard cap at 4096 bytes being read per iterations and they don't end up on
> the LOH. Looking at your code, you potentially create 4 1MB large objects
> every round. So those likely end up somewhere in your memory stack that the
> JVM garbage collector doesn't clean up very quickly.
> I did some quick Google searches about it and it seems a fairly common
> when it comes to Java and object generation. I think it might be worth it
> do a quick search to optimize on that front.
> Hopefully someone more knowledgeable about Java can chime in, but I feel it
> might be a worthwhile area to look into while waiting for a reply!
> Sent from:
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
Geoweb Italia S.r.l.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapguide-users