jonalv
jonalv

Reputation: 6116

How to make shipped Eclipse based application use all memory on users computer?

I am shipping an Eclipse based application and want to have maximum Heap size. How can I make my application use all avilable memory on different machines. All I have found so far is the paramaters for setting heapsize that I can send the JVM but these are hardcoded. Basically I want the JVM to use whatever memory is available on the machine. Hard coding is not good enough.

Is there an easy way of doing this?

Upvotes: 0

Views: 80

Answers (1)

David Oliván
David Oliván

Reputation: 2725

Not possible using standard JVM features. JVM parameters specify the amount of memory to reserve (-Xmx...), not possible to specify "take all memory available". You could try a reasonable value like 1.2GB, that is the upper limit in Windows XP 32bit, for example. The problem is that the OS could not reserve all memory required by JVM so you must be more conservative.

The other approach is to calculate the available memory externally (script, native utility) and then set the JVM parameter with that value. NOt know if any installer like Install4J could achieve this.

Upvotes: 1

Related Questions