From owner-freebsd-questions Thu Apr 4 22: 6:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from evil.ki.iif.hu (evil.ki.iif.hu [193.225.13.42]) by hub.freebsd.org (Postfix) with SMTP id 5212137B41D for ; Thu, 4 Apr 2002 22:06:46 -0800 (PST) Received: (qmail 30305 invoked by uid 1003); 5 Apr 2002 06:01:00 -0000 Date: Fri, 5 Apr 2002 08:01:00 +0200 (CEST) From: Stefan Peter To: freebsd-questions@FreeBSD.ORG Subject: Virtual Memory question Message-ID: <20020405074847.I29381-200000@evil.ki.iif.hu> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1147329000-1017986460=:29381" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1147329000-1017986460=:29381 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi All, Though I'm not member of this mailing-list I was advised to write here to get some help in the deep details of FreeBSD virtual memory management. My problem is that I have written a small piece of code (the heart of all problems :-) which tries to determine the total physical memory, free physical memory, swap and free swap. I used sysctl() calls to obtain virtual memory statistics: vmtotal. I use FreeBSD 4.5. When I ran the code I experienced the following: > ./a.out Physmem: 1069248512 VMem: t_vm 2149661375 t_avm 11974 t_rm 254525 t_arm 3188 I.e. the total virtual memory has been extremely large in comparison with total real memory. I'm not sure I have done the right measurement, but I found no other virtual memory statistics, than vmtotal. I also tried to use kvm interface without any success. I have put my (very basic) code in the appendix. Any help would be highly appreciated! Cheers, Peter Stefan --0-1147329000-1017986460=:29381 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="mem.c" Content-Transfer-Encoding: BASE64 Content-ID: <20020405080100.I29381@evil.ki.iif.hu> Content-Description: Content-Disposition: attachment; filename="mem.c" I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3R5cGVzLmg+DQoj aW5jbHVkZSA8c3lzL3N5c2N0bC5oPg0KI2luY2x1ZGUgPHZtL3ZtX3BhcmFt Lmg+DQojaW5jbHVkZSA8c3lzL3RpbWUuaD4NCiNpbmNsdWRlIDxzeXMvcmVz b3VyY2UuaD4NCiNpbmNsdWRlIDxzeXMvdm1tZXRlci5oPg0KDQppbnQgbWFp bigpIHsNCglpbnQgaSwgbWliWzJdOw0KCXNpemVfdCBsZW47DQoJaW50IHBt Ow0KCXN0cnVjdCB2bXRvdGFsIHRvdGFsOw0KCWludCBwYWdlc2l6ZTsNCg0K CWxlbiA9IDI7DQoJc3lzY3RsbmFtZXRvbWliKCJody5waHlzbWVtIiwgbWli LCAmbGVuKTsNCglsZW4gPSBzaXplb2YocG0pOw0KCWlmIChzeXNjdGwobWli LCAyLCAmcG0sICZsZW4sIE5VTEwsIDApID09IC0xKSBwZXJyb3IoInN5c2N0 bCIpOw0KCWVsc2UgaWYgKGxlbiA+IDApIHByaW50ZigiUGh5c21lbTogJWRc biIsIHBtKTsNCg0KCW1pYlswXT1DVExfVk07DQoJbWliWzFdPVZNX01FVEVS Ow0KCWxlbj1zaXplb2YgdG90YWw7DQoJaWYgKHN5c2N0bChtaWIsIDIsICZ0 b3RhbCwgJmxlbiwgTlVMTCwgMCkgPT0gLTEpIHBlcnJvcigic3lzY3RsIik7 DQoJZWxzZSBpZiAobGVuID4gMCkgcHJpbnRmKCJWTWVtOiB0X3ZtICV1IHRf YXZtICV1IHRfcm0gJXUgdF9hcm0gJXVcbiIsIHRvdGFsLnRfdm0sIHRvdGFs LnRfYXZtLCB0b3RhbC50X3JtLCB0b3RhbC50X2FybSk7DQoJDQoJcmV0dXJu IDA7DQp9DQo= --0-1147329000-1017986460=:29381-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message