이클립스에서 Java Heap Size 설정하기

|

이클립스에서 Java Heap Size 설정하기

구글에서 Eclipse java heap size 를 검색하니 우선
http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F
http://www.brooksandrus.com/blog/2006/11/23/setting-eclipse-and-java-application-jvm-heap-size-on-mac-os-x/
위의 두 가지 글에 검색됩니다.

위 글들은 두 가지 문제에 대해서 설명을 하고 있는데,
하나는 eclipse 자체를 실행할 때의 OutofMemory 에러에 대한 해결책과
다른 하나는 eclipse 내에서 코딩 중인 프로그램을 실행할 때 jvm에 Xmx 등의 Heap size 관련 변수를 어떻게 넘겨주냐는 것입니다.

1. Eclipse 자체를 실행할 때의 문제
(1)  다음과 같이 eclipes를 실행할 때 argument를 넘겨주는 것입니다.

사용자 삽입 이미지

(2) eclipse.ini파일을 수정합니다.
eclipse.ini는 이클립스 실행파일과 같은 곳에 있으며 제가 같고 있는 파일의 내용은 다음과 같습니다.

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
128M
-vmargs
-Xms40m
-Xmx512m

필요한 만큼 수정해주면 될 것 같습니다. Xmx가 512메가로 지정되있군요. 흠흠.

2. Eclipse 내에서 애플리케이션을 실행할 때의 문제
상단 메뉴에서 Run -> Open Run Dialog 를 실행하여 Run Dialog를 여신다음,
다음과 같이 VM arguments에 입력해주시면 됩니다.
간단하군요.
사용자 삽입 이미지




Some JVMs put restrictions on the total amount of memory available on the heap. If you are getting OutOfMemoryErrors while running Eclipse, the VM can be told to let the heap grow to a larger amount by passing the -vmargs command to the Eclipse launcher. For example, the following command would run Eclipse with a heap size of 256MB:

eclipse [normal arguments] -vmargs -Xmx256M [more VM args]

The arguments after -vmargs are directly passed to the VM. Run java -X for the list of options your VM accepts. Options starting with -X are implementation-specific and may not be applicable to all VMs.

You can also put the extra options in eclipse.ini.

Here is an example;

-startup
plugins/org.eclipse.equinox.launcher_1.0.100.v20080501.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.100.v20080428-1330
-showsplash
org.eclipse.platform
-vm
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java
-vmargs
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M
-XX:MaxPermSize=512M
 


And