A natural language handler that is deployed to the line after encapsulation is web-service.
But recently there has been a memory overflow situation, frequent out of memories.
First blindly try to add-xx:-usegcoverheadlimit to the startup script.
Because according to reason not found, still frequent out of memory, can only observe jstat-gcutil <pid>, see Laosheng generation memory drop down, restart the program.
The service program is simple, simple to receive parameters, natural language processing, return data, in addition to natural language processing module, are method parameters, there is no memory leak situation.
The first time to solve this memory overflow problem, there is no big clue. Always know that Java can dump memory, so try to analyze the memory with the mat.
When analyzing memory, look directly at the Dominator tree, and look at all instances of the root reference, and that instance memory usage is at a glance.
The cause of the memory overflow is found in this way:
There are 100,000 words of text sent by the service requestor, Natural language processing module creates a lot of variables, consumes a lot of memory, and the analysis of large text is slow, the memory occupied has not been released, resulting in the subsequent data processing can not obtain sufficient memory.
At this point, another large text, the service is hung up.
13333333333333~
Remember a Java program memory overflow problem