Results 1 to 3 of 3
Thread: Memory Allocation
- 03-15-2010, 04:01 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 26
- Rep Power
- 0
Memory Allocation
Guys
I wonder if one of you knows the answer to the below.
When you start a JVM, you can specify the maximum amount of memory it will use (i.e. that will be available to the application it will run). On Win32 systems, this amount of memory has to be in a single block. In other words, the JVM will use an amount of memory less than or equal to the value you specify at startup.
Is there any way to find-out what this value actually is?
Does anybody know if there are Java libraries that can defrag the system memory? I need the maximum I can get so I would like to defrag the RAM before launching my application. I plan to use a seperate JVM to do that so my launch sequence will look something like the below.
1) Start small JVM + App to defrag RAM and report the amount available
2) Launch big JVM + Main App
Any comments are much appreciated.
Regards
Patrick
- 03-15-2010, 10:11 PM #2
Senior Member
- Join Date
- Jan 2009
- Posts
- 671
- Rep Power
- 5
To find out how much memory is available to your application, use
Java Code:public long Runtime.getRuntime().totalMemory()
- 03-16-2010, 01:14 AM #3
Senior Member
- Join Date
- Mar 2010
- Posts
- 266
- Rep Power
- 4
Similar Threads
-
Array memory allocation
By number5isalive in forum Advanced JavaReplies: 8Last Post: 10-14-2009, 08:04 AM -
Memory Allocation
By kishan in forum New To JavaReplies: 3Last Post: 09-19-2009, 05:47 PM -
Resource management allocation
By jyothi.priyanka in forum New To JavaReplies: 0Last Post: 04-04-2009, 01:25 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


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks