简体   繁体   English

Java Web应用程序和内存

[英]Java Web Application and memory

I have written an JSF web application (I really like the technology). 我已经编写了一个JSF Web应用程序(我非常喜欢该技术)。 I have noticed that when I use the application the memory used by java.exe goes up and up and it will never goes down. 我已经注意到,当我使用该应用程序时,java.exe使用的内存会不断增加,并且永远不会减少。 I use Java SE 7/8, Glassfish 4.0 and JSF 2.2.5. 我使用Java SE 7/8,Glassfish 4.0和JSF 2.2.5。 The application is using connection pool for the MariaDB server. 该应用程序正在使用MariaDB服务器的连接池。 The more data I pull from the server, the more memory java.exe is using. 我从服务器提取的数据越多,java.exe使用的内存就越多。

How can I find what is causing this and how can I fix it? 我如何找到造成这种情况的原因以及如何解决? If you need more information let me know. 如果您需要更多信息,请告诉我。

First, a tool you can use to check your memory is JVisualvm. 首先,可以用来检查内存的工具是JVisualvm。 It's distributed with JDK, so check for it in your JDK's installation path, in /bin directory. 它与JDK一起分发,因此请在JDK的/bin目录中的安装路径中进行检查。

Then, there are some params you can pass to jvm at runtime. 然后,有一些参数可以在运行时传递给jvm。 This parameters are util for establish memory use of your application. 此参数可用于建立应用程序的内存使用。 Maybe this link is useful for you: http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html 也许此链接对您有用: http : //www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

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

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