jts icon indicating copy to clipboard operation
jts copied to clipboard

Java multipoint buffer memory overflow, what's a good way

Open liukuankuan opened this issue 3 years ago • 6 comments

After recognizing the map, our program generates multiple points, and then buffer the memory overflow. After I debug the single point buffer, it is OK, and after simplification, the memory overflow will occur again. If single point buffer and simplification are used, the final result seems to be wrong. What's a good method

The following is the detailed code: BufferOp bufOp = new BufferOp(geometry); bufOp.setEndCapStyle(BufferParameters.CAP_SQUARE); Geometry geometryBuffer = bufOp.getResultGeometry(bufferDistance);

   Geometry geometryBufferSimplify = VWSimplifier.simplify(geometryBuffer, 0.05);

The coordinateArray is more than 400000

image

liukuankuan avatar Oct 11 '22 12:10 liukuankuan

the full stack trace would be helpful analysing your problem

mprins avatar Oct 11 '22 14:10 mprins

As would input data that reproduces the problem. The description of the problem isn't clear to me at all.

On Tue, Oct 11, 2022 at 7:26 AM Mark Prins @.***> wrote:

the full stack trace would be helpful analysing your problem

— Reply to this email directly, view it on GitHub https://github.com/locationtech/jts/issues/913#issuecomment-1274778417, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA25SXJQJMNFAOMZZZWYCPTWCV2JZANCNFSM6AAAAAARCHUI6I . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dr-jts avatar Oct 11 '22 15:10 dr-jts

Hello, the line pointed by the arrow reports gc

image

liukuankuan avatar Oct 12 '22 09:10 liukuankuan

Your report is still missing key information for debugging and/or analysis, but the essence is you need more memory for your program; this may help: https://www.baeldung.com/java-gc-overhead-limit-exceeded

mprins avatar Oct 12 '22 11:10 mprins

Thank you for your answer. I adjusted the jvm memory size to 5G in the local idea Exe program observation, to bufOp The getResultGeometry (bufferDistance) line of code will be gc. It is reasonable to say that the size of the jvm is enough. Why is gc still needed?

liukuankuan avatar Oct 13 '22 06:10 liukuankuan

哥们,你的问题解决了吗?我现在也是程序报内存溢出

l2365775436 avatar Dec 22 '22 10:12 l2365775436