Opened 6 years ago

Closed 6 years ago

#1960 closed defect (fixed)

ByteSource and ByteReader memory leak in Java Api

Reported by: hubu Owned by: Andy Zhang
Priority: high Milestone: 2.3
Component: Web API Version: 2.2.0
Severity: critical Keywords: Memory leak
Cc: hubu External ID: 1453408

Description

Memory leak happens when get MgByteReader? from a MgByteSource?. This only happens in Java Api. It's a Swig issue.

Here is the sample code:

for (int i = 0; i < maxCount; i++) {

MgByteSource? byteSource = new MgByteSource?(xmlBytes, xmlBytes.length);

MgByteReader? layerDefinitionNewResourceContent = byteSource.GetReader?();

layerDefinitionNewResourceContent.delete(); layerDefinitionNewResourceContent = null;

byteSource.delete(); byteSource = null;

System.gc();

}

Change History (1)

comment:1 Changed 6 years ago by jng

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.