Opened 13 years ago
Closed 12 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();
}
Note:
See TracTickets
for help on using tickets.