Eclipse memory settings when getting “Java Heap Space” and “Out of Memory”

前端 未结 11 803
野的像风
野的像风 2020-11-27 13:06

When trying to launch and run a flex/java project in eclipse I kept getting a \"Out of Memory Exception\" and \"Java Heap Space\" using Eclipse, Tomcat and a JRE.

Wh

11条回答
  •  一生所求
    2020-11-27 13:35

    There's a couple of different memory settings for good reason.

    The eclipse memory setting is because Eclipse is a large java program. if you are going to have a huge amount of files open in a couple of projects, then you're going to want to give Eclipse more ram. This is an issue only on "enterprise" systems normally personal projects wont use that many file handles or interfaces.

    The JRE setting is how much ram to allow the java runtime when you run your project. This is probably the one you want when you are running some memory hogging application. I've run mathematical projects that needed a few gigs of ram and had to really tell the JRE it was okay, the JVM kept assuming my program was in some leaky runaway state, but I was doing it on purpose, and had to tell JVM specifically what it was allowed to use.

    Then Catalina's memory setting is for the application server Tomcat. That server needs memory for each application and concurrent users. This blends with the JRE number because your project might be a web application and I'm not sure which one needs the memory.

提交回复
热议问题