DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th July 2010
werwer werwer is offline
Port Guard
 
Join Date: May 2010
Posts: 10
Default free memory

i still can't understand how much free memory my OpenBSD machine has.

Code:
Memory: Real: 32M/136M act/tot  Free: 863M  Swap: 0K/1279M used/tot
Is the used memory 32MB or 136MB?
Reply With Quote
  #2   (View Single Post)  
Old 7th July 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

I don't have the source code in front of me at this instant, but my recollection is the first two numbers are <active processes> / <all processes>. The number after "Free" is unassigned RAM.
Reply With Quote
  #3   (View Single Post)  
Old 7th July 2010
werwer werwer is offline
Port Guard
 
Join Date: May 2010
Posts: 10
Default

So in the above I've got 992/1024MB ram free?
Reply With Quote
  #4   (View Single Post)  
Old 7th July 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

No, you have 863MB free. Unassigned to any process.

You have 136MB assigned to processes.

Of those processes, some are active, some are not. The active processes are consuming 32MB of RAM.

863+136= 999MB. The rest of your 1GB, about 25MB, is consumed by reserved memory. Video RAM, as an example. I'm not sure if the kernel is included in the count of "active" memory or not, or if it falls into the unmentioned reserve. I honestly don't recall, exactly what is considered reserved, nor, if I had a system in your situation, with so much unassigned RAM, would I particularly care.

If you can read C, you can look through the source code, which, if I am not mistaken, will be in /usr/src/usr.bin/top if you have acquired the source. You can determine, from the code, which syscalls are used to obtain information, then dig through each syscall's man page and then the related kernel source code, for the definitive answers.
Reply With Quote
  #5   (View Single Post)  
Old 7th July 2010
werwer werwer is offline
Port Guard
 
Join Date: May 2010
Posts: 10
Default

but why 136MB used? i do not run anything big :/
Reply With Quote
  #6   (View Single Post)  
Old 7th July 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

It's not as simple as "used" or "free", memory management is a complex aspect of modern operating systems.. a portion of physical memory is reserved for the kernel, and some memory is used for various system caches, like VFS/block caches, and network buffers.

Modern memory management works on the concept of "pages", and "virtual memory", pages being small chuck of memory, which are mapped into a processes memory space.. these pages don't have to be in physical memory and can be temporarily placed on secondary storage (..disk swap) and the released memory can be allocated by another process or even used for caches.

It's very complicated, but, you can either trust that the kernel is managing your memory in the best way possible.. or.. read the source, as jggimi suggests.
Reply With Quote
  #7   (View Single Post)  
Old 7th July 2010
werwer werwer is offline
Port Guard
 
Join Date: May 2010
Posts: 10
Default

Ok, thank you both!
Reply With Quote
  #8   (View Single Post)  
Old 7th July 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

As a note, OpenBSD works on systems with very little memory.. <= 16M even, but, if you have more memory, it's going to make use of it (..except for memory above 4G on x86).

Unused memory is wasted memory, as the saying goes for Unix systems.
Reply With Quote
  #9   (View Single Post)  
Old 7th July 2010
Android1's Avatar
Android1 Android1 is offline
Fdisk Soldier
 
Join Date: Mar 2009
Posts: 60
Default

Quote:
Originally Posted by BSDfan666 View Post
As a note, OpenBSD works on systems with very little memory.. <= 16M even, but, if you have more memory, it's going to make use of it (..except for memory above 4G on x86).

Unused memory is wasted memory, as the saying goes for Unix systems.
And on amd64, right? The last I knew, OpenBSD did not support bigmem.
Reply With Quote
Old 7th July 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

amd64 is an x86-based architecture. You and BSDfan666 are in violent agreement.
Reply With Quote
Old 8th July 2010
rpindy rpindy is offline
Fdisk Soldier
 
Join Date: May 2010
Posts: 59
Default

Quote:
Originally Posted by jggimi View Post
amd64 is an x86-based architecture. You and BSDfan666 are in violent agreement.
amd64 is also called x86_64. So the _64 is just tacked on when referring to 64 bit.
Reply With Quote
Old 8th July 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

That's just the vendor-neutral way of referring to it, but, really, AMD came up with it first, so it's amd64, just like how the x86 port is called i386.

Clearly all of this is redundant though, and has little baring on this thread.
Reply With Quote
Old 8th July 2010
Android1's Avatar
Android1 Android1 is offline
Fdisk Soldier
 
Join Date: Mar 2009
Posts: 60
Default

Quote:
Originally Posted by jggimi View Post
amd64 is an x86-based architecture. You and BSDfan666 are in violent agreement.
Quote:
Originally Posted by rpindy View Post
amd64 is also called x86_64. So the _64 is just tacked on when referring to 64 bit.
Quote:
Originally Posted by BSDfan666 View Post
That's just the vendor-neutral way of referring to it, but, really, AMD came up with it first, so it's amd64, just like how the x86 port is called i386.

Clearly all of this is redundant though, and has little baring on this thread.
All very true. When I think of x86, though, I think of the 32-bit variant.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory Not Detected jrs OpenBSD Installation and Upgrading 3 19th May 2009 05:50 PM
What's the difference between these two memory modules? Carpetsmoker General Hardware 2 25th November 2008 03:13 PM
KDE4 uses a lot of memory... mdh FreeBSD General 6 21st October 2008 06:21 AM
dwindling memory chavez243 FreeBSD General 15 26th August 2008 04:06 PM
Memory cache graudeejs FreeBSD General 3 9th July 2008 03:27 AM


All times are GMT. The time now is 05:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick