简体   繁体   English

Tomcat中的内存分配和GC

[英]Memory Allocation and GC in Tomcat

I am using tomcat-7 and java-8 with spring framework. 我将tomcat-7和java-8与spring框架一起使用。 I just deployed an application in webapps. 我刚刚在webapps中部署了一个应用程序。 After that, I monitored memory in visualvm, Below is the screenshot. 之后,我在visualvm中监视了内存,以下是屏幕截图。

在此处输入图片说明

There is no hit on tomcat and used heap is increasing and after a limit GC performed. 在tomcat上没有命中,并且在执行限制GC之后使用的堆正在增加。 I want to know, If this is normal behaviour or something wrong with my web application. 我想知道,这是正常现象还是我的Web应用程序出现问题。

Yes it is how a healthy application memory usate should looks like. 是的,这是健康的应用程序内存使用情况的外观。

The reason for the double-sawtooth pattern is that the JVM needs to allocate memory on the heap as new objects are created as a part of the normal program execution. 双锯齿模式的原因是,随着新对象的创建(作为常规程序执行的一部分),JVM需要在堆上分配内存。 Most of these objects are short-lived and quickly become garbage. 这些对象大多数都是短暂的,很快就会变成垃圾。 These short-lived objects are collected by a collector called “Minor GC” and represent the small drops on the sawteeth 这些短寿命的物体由名为“次要GC”的收集器收集,代表锯齿上的小液滴

https://plumbr.eu/blog/memory-leaks/memory-leaks-fallacies-and-misconceptions https://plumbr.eu/blog/memory-leaks/memory-leaks-fallacies-and-misconceptions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM