Palai

Palai

程序员 | 开源爱好者 | 喜欢交友

Heap Memory Overflow - Internship Memo

Background: Research platform for internal information and literature queries.
Formal environment error, displaying oom-Java heap space. First, check if there are any large objects or recursive code created, then appropriately increase the memory. Opening any PDF fails, possibly due to memory not being released (suspecting a bug in the PDF reading tool). Used jconsole to observe the memory changes during program execution, and the memory consistently increased. Local analysis showed continuous object creation. Analyzed heap memory snapshot (XX:+HeapDumpOnOutOfMemoryError heap memory snapshot can be added later), preliminary analysis showed continuous invocation of the interface for generating font objects, which means continuous creation of font objects.
Once the source is found, it's easy to handle. Found the code that continuously creates objects for this interface, should extract it as a static variable instead of creating it in the static function every time.

PS: Encountering heap memory overflow for the first time in production was quite exciting. (Just that the formatting of the editing was terrible, need to practice in this area.)

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.