RFR(S): 8025942: Implement os::Bsd:available_memory
harold.seigel at oracle.com
Fri Oct 11 08:33:11 PDT 2013
Since host_statistics64 is unlikely to fail, can you add an assert to
ensure that we catch the rare case when it fails?
On 10/11/2013 11:26 AM, Gerard Ziemski wrote:
> hi David,
> On 10/10/2013 11:32 PM, David Holmes wrote:
>> Hi Gerard,
>> On 11/10/2013 5:14 AM, Gerard Ziemski wrote:
>>> Please review this fix that implements os::Bsd:available_memory()
>>> This is a simple change - we use a similar implementation that Apple
>>> itself uses (see
>>> to implement BSD (Apple platform only) implementation for finding out
>>> available (free) memory.
>> Is host_statistics64 likely to fail? If not then I think we should
>> trap any failures, at least with an assert, so that they are noticed.
>> Otherwise this might fail all the time and we would be none the wiser.
> I looked at the implementation of host_statistics64 in XNU src and the
> only reason it will fail is if we pass wrong parameters (such as NULL
> host). Otherwise, it is guaranteed to return a valid value, so there
> does not seem to be a need for an assert here.
More information about the hotspot-dev