[mapguide-trac] #1294: custom output causes memory leak?

MapGuide Open Source trac_mapguide at osgeo.org
Thu Mar 11 22:08:21 EST 2010


#1294: custom output causes memory leak?
------------------------+---------------------------------------------------
   Reporter:  ioly      |       Owner:       
       Type:  defect    |      Status:  new  
   Priority:  medium    |   Milestone:       
  Component:  Web API   |     Version:  2.0.2
   Severity:  critical  |    Keywords:       
External_id:            |  
------------------------+---------------------------------------------------
 version 2.0.2, bundled tomcat. When using MgByteReader.Read to render
 custom output, [[BR]]
 found memory leak.
 my code:
 {{{
 MySession session = ...
 MyRenderOption option = ...
 ...
 MgSelection selection = new MgSelection(map);
 MgByteReader byteReader = session.getRenderingService().RenderMap(
                 map,
                 selection,
                 envelope,
                 option.ImageWidth,
                 option.ImageHeight,
                 new MgColor(option.R, option.G, option.B),
                 "PNG"
 );

 byte[] tmp = new byte[1024 * 1024];
 while (true) {
             int len = byteReader.Read(tmp, tmp.length);
             log(len);
             if (len <= 0){
                 break;
             }
 ...
 }}}

 It worked and outputed the image correctly as expected, but the memory use
 [[BR]]
 increased very fast and the jvm crashed after several calls.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1294>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list