Results 1 to 12 of 12
- 06-09-2010, 02:48 AM #1
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
Memory in java doesn't correspond with eclipse.ini
Hello everyone,
I have to make at least 2 really big objects (1 int[13800][13800] and 1 int[13800][9980]).
Therefore I need a lot of memory (more then 1GB).
I tried to change /etc/eclipse.ini (I use Ubuntu 10.04) and it looks now like this:
I have 4GB of ram in this and swapping should also be used if needed.Java Code:-startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.200.v20090519 -showsplash org.eclipse.platform --launcher.XXMaxPermSize 3072m -vmargs -Xms2048m -Xmx3072m -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
If I check the following:
I get following returnJava Code:public static void main(String[] args) { System.out.println(Runtime.getRuntime().maxMemory()); System.out.println(Runtime.getRuntime().freeMemory()); System.out.println(Runtime.getRuntime().totalMemory()); }
920911872
61738824
62062592
These are numbers expressed in bytes, so it is a lot less as I try to get.
I hope someone can give me a clue.
Thanks in advance,
ChristopheLast edited by christophe; 06-09-2010 at 02:52 AM.
- 06-09-2010, 03:15 AM #2
Have you tried just running eclipse with:
You may also want to check out Eclipse and memory settings » Max's BlogJava Code:eclipse -vmargs -Xms2048m -Xmx3072m
(its not my blog, its just a random one i found which helped sort out my problem a while back :P)
Berkeleybross
- 06-09-2010, 03:25 AM #3
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
Thanks berkeleybross for looking into my problem.
I also used this file to get this far, but it doesn't work for me (even command line).
Even if I try with less memory maxMemory() etc. keeps the same
Java Code:eclipse -vmargs -Xms128m -Xmx256m
Last edited by christophe; 06-09-2010 at 03:28 AM.
- 06-09-2010, 03:28 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 06-09-2010, 03:37 AM #5
I dont know much about permsize but what i understand is its seperate from heap space and i think its assigned before heap space.--launcher.XXMaxPermSize
3072m
The website i linked to shows a permsize of about 128m. Have you tried setting it at about that? I've got a feeling its ninja'ing your memory leaving nothing for the heapspace.
- 06-09-2010, 03:39 AM #6
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
@Eranga:
I need to parse 9980 documents and extract all person names out of these. With this I have to make a term-document matrix in which every cell contains the term-frequency in a specific document. As there are 13840 unique names this is a 13840x9980 matrix.
In a next step I have to calculate the term-term correlation matrix, so this becomes a 13840x13840 matrix.
This will be used to try some clustering algorithms.
As you can see this project for school isn't really about 'good' design but more about good algorithms. If you can give me a good alternative to calculate these matrices I am eager to hear
- 06-09-2010, 03:43 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I'm not exactly clear what you mean by "parse 9980 documents". How did you pass all those things? And also once you process documents how did you start to build the matrix? Did you write them into a file or keep in heap? I think it is.
- 06-09-2010, 03:45 AM #8
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
setting XXMAxPermSize to 128 or 256 doesn't change anything either.
- 06-09-2010, 03:50 AM #9
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
@Eranga
I save and load them from a data file after creating it (serialized objects) so I only have the objects I need loaded.
After loading the term-document matrix totalMemory() tells me it uses 594608128 bytes so this works. The problem is that i need to create another big matrix while having the other object still in memory.
- 06-09-2010, 03:58 AM #10
I really cant think of much to help you...
Really stabbing in the dark, but have you tried running just the java file via command line instead of through eclipse?
May see if it really is a problem with the ini file.
Also have you tried looking at the task manager to see if linux thinks the memory is a different size than java?
And can you tell us the exact error message that occurs? Out of memory errors dont usually tell much but every little helps..
- 06-09-2010, 09:26 AM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Just a question, but is this a 64 bit system with a 64 bit Java?
If not then you actually only have about 1.5G max, some of which is used by the JVM itself and so isn't heap.
Also, as has been pointed out, you don't want perm size to be anywhere near that amount. Perm space is for storing class information.
One more thing, you really don't want to be using swapping with Java. It really, really slows down the garbage collection.
Oh yes, and when running your code is it actually running inside the eclipse JVM or another one? Because I think you should be setting this in the individual run configuration for the project and not for the Eclipse launcher...
- 06-09-2010, 10:58 AM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
Java Memory Issue
By personal in forum Advanced JavaReplies: 12Last Post: 01-07-2012, 02:05 PM -
Java serialization - why do I run out of memory upon restore?
By kslnet in forum Advanced JavaReplies: 9Last Post: 05-21-2010, 11:22 PM -
memory game in JAVA
By lclclc in forum New To JavaReplies: 19Last Post: 10-18-2009, 04:41 PM -
Out of memory error in eclipse
By Java.child in forum New To JavaReplies: 5Last Post: 09-05-2008, 04:50 PM -
how do I increase memory allocated to code cache (Non Heap Memory)
By manibhat in forum Advanced JavaReplies: 2Last Post: 08-21-2008, 07:33 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks