Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2574 closed bug (fixed)

Something wrong with memory calculation.

Reported by: bga Owned by: axeld
Priority: high Milestone: R1
Component: System/Kernel Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This bug becomes evident when allocating a big chunk of memory in one go. Activity Monitor will report a negative amount of used memory. This does not seem to be an Activity Monitor problem as even sysinfo acts in a weird way.

This is what I got before allocating 500 Mb in one go (snippet form sysinfo output):

2013855744 bytes free (used/max 133627904 / 2147483648)

(cached 17035264)

And with the memory allocated:

1397829632 bytes free (used/max 749654016 / 2147483648)

(cached 3696230400)

The values for used memory and cache do not look right.

Change History (3)

comment:1 by anevilyak, 16 years ago

Used memory actually looks like it's in the correct ballpark for an additional 500MB alloc. The fact that the numbers there look more or less sane though makes me suspect vm_page_num_free_pages() is returning the wrong value here, but that implies several possible variables as suspects. Possibly sInactivePageQueue?

comment:2 by bonefish, 16 years ago

Resolution: fixed
Status: newclosed

Should be fixed in hrev26837. Note that a huge allocation won't show up, unless it is fully locked or until the memory is touched. The values now reported by get_system_info() reflect the actual page usage instead of the memory commitment. It wouldn't be too difficult to change that, if the general preference is otherwise. I haven't tested what BeOS does.

comment:3 by axeld, 16 years ago

I like it as is; that just makes more sense to me.

Note: See TracTickets for help on using tickets.