我注意到Spring Boot应用程序不遵守通过Xmx选项设置的内存量. 例如:java -Xss64m -Xmx64m -jar test.jar
I noticed Spring Boot application does not obey the amount of memory set via Xmx option. For example: java -Xss64m -Xmx64m -jar test.jar
我还在控制台上打印了启动时应用程序实际使用的内存量,并显示: 最大内存:61M
I also printed on console the amount of memory really used by application at startup, and shows: Max memory: 61M
long maxBytes = Runtime.getRuntime().maxMemory(); System.out.println("Max memory: " + maxBytes / 1024 / 1024 + "M");当我在访问任何网页之前打开Windows进程时,它显示+ -105M,那么Java怎么说61M?
When I open Windows processes before accessing any web page, it shows +-105M, so how can Java say 61M?
访问任何网页后,它从+ -125M变为+ -135M.为什么会有这样的增加?它应该提供"java.lang.OutOfMemoryError:PermGen空间",但不要以这种方式增加.
After accessing any web page it goes from +-125M to +-135M. Why is there such increase? It should give "java.lang.OutOfMemoryError: PermGen space" but do not increase this way.
如果许多应用程序可能耗尽服务器的内存,这会让我感到担忧.顺便说一句,我正在使用Java 1.8_45
It makes me get worried, if many applications could run out of memory at the server. By the way, I am using Java 1.8_45
推荐答案在监视Spring Boot应用程序之后,我发现了一些可能的原因,例如:
After monitoring the Spring Boot application, I found out some possible reasons such as:
更多推荐
Spring Boot内存消耗增加到超过
发布评论