[mapguide-users] Memory Leak in Java
riccardo.pucci at geowebitalia.it
Fri Dec 20 08:35:00 PST 2019
thanks for the hints!Calling .delete() changes nothing, it was the first
thing I tried to do...
MgByteSource (MgByteSync) instead, works well! For the moment I'll go with
temporary files.I'll try to make some other test with GetResourceContent to
understand if the leak is related to the reader or only to GetResourceData
Il giorno ven 20 dic 2019 alle ore 02:59 Jackie Ng <jumpinjackie at gmail.com>
> Still haven't ran your test code, but I have looked at it at a glance and
> throwing out some ideas to try and pre-emptively solve your problem.
> 1. This may not actually be a memory leak in the classical definition but
> rather a case of memory being allocated faster than the Java GC can clean
> up. All Java proxy classes have a delete() method that tears down the
> underlying associated C++ pointer and frees any associated memory. This
> method is generally called as part of GC finalization. Perhaps try calling
> delete() on your MgByteSource/MgByteReader manually after using them to
> force the matter perhaps?
> 2. Do you need/have to pass file byte buffers around? MgByteSource
> constructor can also take a file path, so there's the option of using temp
> files, which would avoid needing to manage byte buffers and marshaling them
> between Java <-> C++ and avoid allocating memory on the C++ side to handle
> the marshaled bytes.
> - Jackie
> 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