Results 1 to 15 of 15
Thread: Claiming memory at start up
- 08-31-2009, 11:17 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
Claiming memory at start up
Quick question: If explicitly setting max/min heap size = someValue, does the JVM lock get this memory from the OS at start up and lock it from outside use (other apps/JVMs/etc.) to ensure that it will have all the memory it requested?
I am assuming it does, but some verification would be nice.
Thanks!
- 09-03-2009, 07:24 PM #2
Member
- Join Date
- Dec 2008
- Posts
- 64
- Rep Power
- 0
I would have to look into this to tell you 100% for sure but my assumption is that it does and the reason I would assume this is because you will get an error if you try to create a jvm with more memory than is available.
- 09-03-2009, 07:52 PM #3
This is my understanding:
The JVM requests the minimum memory for you app-- whatever is the default or that you set-- at startup from the OS, which could fail. If the app needs more memory at run-time, then the JVM requests another block of memory from the OS until the max is reached. If at any time the OS refuses to give memory, likely because it ran out, then it will throw an exception.Last edited by mrmatt1111; 09-03-2009 at 07:54 PM.
My Hobby Project: LegacyClone
- 09-03-2009, 07:54 PM #4
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
That makes sense.
Also, I saw something yesterday or the day before that backs up this assumption as well.
- 09-03-2009, 07:57 PM #5
Member
- Join Date
- Dec 2008
- Posts
- 64
- Rep Power
- 0
I am basing some of my assumptions off of using JNI, as I have written quite a bit of JNI where if you request to create a JVM with more memory than is available it will not be created, you will get an error in response.
- 09-03-2009, 08:19 PM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
The JVM spec has all those details and then some.
It's also available online for free.
- 09-03-2009, 08:29 PM #7
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
- 09-03-2009, 08:32 PM #8
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
- 09-03-2009, 08:53 PM #9
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
I've seen contradictory statements regarding the garbage collection algorithm used by default on server class machines. One place said that you had to enable a VM argument and another said that it was enabled by default. They were both sun docs referencing the same version.
- 09-03-2009, 09:00 PM #10
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You realize of course that your statements are useless without links to the documents?
In fact the JVM spec does not impose any particular gc algorithm. A blank gc method is actually a valid implementation.
- 09-03-2009, 09:35 PM #11
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
- 09-03-2009, 09:49 PM #12
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You don't have to dig through the "internets". You said yourself the errors where in the sun docs so search space is reduced drastically.
Better not claims that you cannot prove.
- 09-03-2009, 10:25 PM #13
senorbum, it was a good question. :)
edit: i meant that the original post was a good question.Last edited by mrmatt1111; 09-04-2009 at 07:05 AM.
My Hobby Project: LegacyClone
- 09-03-2009, 11:24 PM #14
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
- 09-04-2009, 08:45 AM #15
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Like I said, without any links to prove it, your statements are completely useless. The problem with posting such strong points on the internet is that you mislead people who rely on posted information.
If you don't have proof then please don't post such misleading things and let people continue to read the Sun documentation.
I can't stop you from posting whatever you want but I will call it false to let others know the truth until you can prove otherwise.
Similar Threads
-
How do you start a Java program from the "Start" menu under Windows?
By ScottVal in forum New To JavaReplies: 5Last Post: 03-20-2009, 10:04 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 -
Out of memory
By mew in forum New To JavaReplies: 1Last Post: 01-20-2008, 08:55 AM -
Memory
By mew in forum CLDC and MIDPReplies: 0Last Post: 12-28-2007, 11:02 AM -
Consumption of memory
By Daniel in forum Advanced JavaReplies: 1Last Post: 07-06-2007, 09:11 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks