[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reasonable values for the -Xmx parameter ?

Sylvestre Ledru wrote:
> Le lundi 08 mars 2010 à 20:11 +0100, Vincent Fourmond a écrit :
>>   I'm wondering really what could be a decent value for -Xmx parameter.
>> I used to think that the lowest parameter that seem to let the program
>> run for every arch is good, but I don't think anymore this is a good idea:
>>   * the program might be clever enough to not allocate more memory than
>> it can, while still being able to use significantly more to speedup (for
>> instance through the use of caches)
>>   * the tightest the memory, the more often the GC has to run, which
>> could lead to performance penalties.
>>   My question then is: is there a problem setting it to a value big
>> enough (say, -Xmx1G) for a standard app ? (I'm thinking about freecol,
>> that takes up quite a lot of memory) After all, most of the other
>> programming languages don't limit memory by default, and the use of the
>> ulimit shell builtin permits some fine tuning for this parameter (and
>> others).
>>   What do you think ?
> I had previous bad experiences on setting more memory than available. It
> leaded to unexpected crashes and I had to come back to 256m. 
> It is a really pity that it is still mandatory to specify it... 

  All right...

  Then, maybe I could add a function to java-wrappers that would find
out what is a 'good default' for that parameter, getting something more
than the memory required but still reasonably less than the memory
present on the machine ?

  Would that be useful for anyone else than me ?



The moon was high now, in a sky as black as a cup of coffee that
wasn't very black at all.
 -- Terry Pratchet, Men at arms

Vincent, listening to Roads (Portishead)

Reply to: