RFR(S): 8025942: Implement os::Bsd:available_memory

Dmitry Samersoff dmitry.samersoff at oracle.com
Thu Oct 10 12:54:47 PDT 2013


Gerard.

> host_statistics64 can fail in theory,

Agree. You are right. Lets leave it as is.

-Dmitry

On 2013-10-10 23:50, Gerard Ziemski wrote:
> hi Dmitry,
> 
> Why should we move it into '#else' clause?
> 
> host_statistics64 can fail in theory, so from code coverage point of
> view it's useful to have the variable initialized to some 'sane' value,
> otherwise we would need to initialize it something and then we need to
> answer the question - what should it be initialized to? And in that case
> a reasonable value would be what it currently is.



> 
> 
> cheers
> 
> On 10/10/2013 2:36 PM, Dmitry Samersoff wrote:
>> Gerard,
>>
>> Please move
>>
>> uint64_t available = physical_memory() >> 2;
>>
>> under #else
>>
>> Besides that looks good for me
>>
>> -Dmitry
>>
>>
>> On 2013-10-10 23:14, Gerard Ziemski wrote:
>>> Please review this fix that implements os::Bsd:available_memory()
>>>
>>> Description:
>>>
>>> This is a simple change - we use a similar implementation that Apple
>>> itself uses (see
>>> http://opensource.apple.com/source/system_cmds/system_cmds-498.2/vm_stat.tproj/vm_stat.c)
>>>
>>> to implement BSD (Apple platform only) implementation for finding out
>>> available (free) memory.
>>>
>>>
>>> Testing:
>>>
>>> Passed JPRT, vm quicklooks
>>>
>>>
>>> References:
>>>
>>> http://cr.openjdk.java.net/~dsamersoff/sponsorship/gziemski/JDK-8025942/webrev.01/
>>>
>>>
>>> https://bugs.openjdk.java.net/browse/JDK-8025942
>>>
>>>
>>> cheers
>>>
>>
> 


-- 
Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.


More information about the hotspot-dev mailing list