Re: [mapguide-users] Memory Leak in Java

2019-12-20 Thread Riccardo Pucci
Hi Jackie 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 r

Re: [mapguide-users] Memory Leak in Java

2019-12-19 Thread Jackie Ng
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. Al

Re: [mapguide-users] Memory Leak in Java

2019-12-19 Thread Riccardo Pucci
Hi Jackie Exactly, I wanted to test if the leak is related to Java API only. .Net test case works as expected. Il giorno gio 19 dic 2019 alle ore 08:26 Jackie Ng ha scritto: > I've just downloaded your test code and I'll take a look sometime over the > xmas/NY break. > > Just to clarify: Is the

Re: [mapguide-users] Memory Leak in Java

2019-12-19 Thread Riccardo Pucci
Hi Benoit 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

Re: [mapguide-users] Memory Leak in Java

2019-12-18 Thread Jackie Ng
I've just downloaded your test code and I'll take a look sometime over the xmas/NY break. Just to clarify: Is the included .net version leaking as well? Or is it just a reference point for what you're trying to achieve in Java? - Jackie -- Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuid

Re: [mapguide-users] Memory Leak in Java

2019-12-18 Thread Benoit Begin
Hi, I'm no Java expert, but I feel it could be a similar issue that you may face 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 lat

[mapguide-users] Memory Leak in Java

2019-12-18 Thread Riccardo Pucci
Hi I'm facing a huge memory leak in ResourceService.GetContentData using Java API. .Net API works well but I need it in Java :) I've written a small test case that can be run on any Mapguide Server since it use just Session Repository. Below the link to the test source code. https://drive.google.