Date: Sat, 20 Sep 2003 13:02:49 +0200 From: Bernd Walter <ticso@cicely12.cicely.de> To: "Ralf S. Engelschall" <rse@engelschall.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Gaps in memory usage summary!? Message-ID: <20030920110248.GE21665@cicely12.cicely.de> In-Reply-To: <20030919211138.GA67987@engelschall.com> References: <20030919211138.GA67987@engelschall.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 19, 2003 at 11:11:39PM +0200, Ralf S. Engelschall wrote: > ------------------------------------------------------------------------------ > FreeBSD-5.1-CURRENT/alpha > > SYSTEM MEMORY INFORMATION: > mem_wire: 32555008 ( 31MB) [ 12%] Wired: disabled for paging out > mem_active: + 57344000 ( 54MB) [ 22%] Active: recently referenced > mem_inactive:+ 116170752 ( 110MB) [ 45%] Inactive: recently not referenced > mem_cache: + 4620288 ( 4MB) [ 1%] Cached: almost avail. for allocation > mem_free: + 12484608 ( 11MB) [ 4%] Free: fully available for allocation > mem_gap_vm: + 31113216 ( 29MB) [ 12%] Memory gap: UNKNOWN > -------------- ------------ ----------- ------ > mem_all: = 254287872 ( 242MB) [100%] Total real memory managed > mem_gap_sys: + 11116544 ( 10MB) Memory gap: Kernel?! > -------------- ------------ ----------- > mem_phys: = 265404416 ( 253MB) Total real memory available > mem_gap_hw: + 3031040 ( 2MB) Memory gap: Segment Mappings?! > -------------- ------------ ----------- > mem_hw: = 268435456 ( 256MB) Total real memory installed > > SYSTEM MEMORY SUMMARY: > mem_used: 121012224 ( 115MB) [ 47%] Logically unused memory > mem_avail: + 133275648 ( 127MB) [ 52%] Logically available memory > -------------- ------------ ----------- ------ > mem_total: = 254287872 ( 242MB) [100%] Logically total memory > ------------------------------------------------------------------------------ > > My remaining questions now are: > > 1. What memory is "map_gap_vm" and why is there no such gap on Intel > boxes but on Alpha boxes? The number I arithmetically calculate is > > vm.stats.vm.v_page_count > - ( vm.stats.vm.v_wire_count > + vm.stats.vm.v_active_count > + vm.stats.vm.v_inactive_count > + vm.stats.vm.v_cache_count > + vm.stats.vm.v_free_count ) > > and I always would expect 0 here, but as you can see it is not at > least on Alpha. Is this a bug in our VM statistic code? Any clues? This point is interesting. On two current alphas I see large positive values: mem_gap_vm: + 30744576 ( 29MB) [ 12%] Memory gap: UNKNOWN mem_gap_vm: + 98672640 ( 94MB) [ 4%] Memory gap: UNKNOWN On a stable system I get the following: [296]srv1.cosmo-project.de# perl ~/freebsd-memory SYSTEM MEMORY INFORMATION: mem_wire: 47742976 ( 45MB) [ 38%] Wired: disabled for paging out mem_active: + 58908672 ( 56MB) [ 47%] Active: recently referenced mem_inactive:+ 11059200 ( 10MB) [ 8%] Inactive: recently not referenced mem_cache: + 6635520 ( 6MB) [ 5%] Cached: almost avail. for allocation mem_free: + 696320 ( 0MB) [ 0%] Free: fully available for allocation mem_gap_vm: + -16384 ( 0MB) [ 0%] Memory gap: UNKNOWN -------------- ------------ ----------- ------ mem_all: = 125026304 ( 119MB) [100%] Total real memory managed mem_gap_sys: + 6660096 ( 6MB) Memory gap: Kernel?! -------------- ------------ ----------- mem_phys: = 131686400 ( 125MB) Total real memory available mem_gap_hw: + 2531328 ( 2MB) Memory gap: Segment Mappings?! -------------- ------------ ----------- mem_hw: = 134217728 ( 128MB) Total real memory installed SYSTEM MEMORY SUMMARY: mem_used: 106635264 ( 101MB) [ 85%] Logically unused memory mem_avail: + 18391040 ( 17MB) [ 14%] Logically available memory -------------- ------------ ----------- ------ mem_total: = 125026304 ( 119MB) [100%] Logically total memory [298]srv1.cosmo-project.de# perl ~/freebsd-memory SYSTEM MEMORY INFORMATION: mem_wire: 49479680 ( 47MB) [ 39%] Wired: disabled for paging out mem_active: + 55934976 ( 53MB) [ 44%] Active: recently referenced mem_inactive:+ 10821632 ( 10MB) [ 8%] Inactive: recently not referenced mem_cache: + 8085504 ( 7MB) [ 6%] Cached: almost avail. for allocation mem_free: + 696320 ( 0MB) [ 0%] Free: fully available for allocation mem_gap_vm: + 8192 ( 0MB) [ 0%] Memory gap: UNKNOWN -------------- ------------ ----------- ------ mem_all: = 125026304 ( 119MB) [100%] Total real memory managed mem_gap_sys: + 6660096 ( 6MB) Memory gap: Kernel?! -------------- ------------ ----------- mem_phys: = 131686400 ( 125MB) Total real memory available mem_gap_hw: + 2531328 ( 2MB) Memory gap: Segment Mappings?! -------------- ------------ ----------- mem_hw: = 134217728 ( 128MB) Total real memory installed SYSTEM MEMORY SUMMARY: mem_used: 105422848 ( 100MB) [ 84%] Logically unused memory mem_avail: + 19603456 ( 18MB) [ 15%] Logically available memory -------------- ------------ ----------- ------ mem_total: = 125026304 ( 119MB) [100%] Logically total memory Maybe a timing glitch on those values for -stable and a leak on -current? However - I'm not shure that memory always have to be on those lists. > 2. What memory is "mem_gap_sys", i.e. > (hw.physmem - (vm.stats.vm.v_page_count * hw.pagesize)) ? > Is this the loaded kernel code? I'm not shure, but I asume that's the kernel and static startup allocation. > 3. What memory is "mem_gap_hw", i.e. > (rounded(hw.physmem) - hw.physmem) ? > Is this caused by some special hardware memory segmenting? On alpha systems this is typically PAL/SRM memory which is not available to the OS. On x86 systems sometimes ROM shadow and so on is not available. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030920110248.GE21665>