LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-14-2006, 04:25 PM   #1
bhavishya_goel
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
Total system physical memory information in linux


Hi,

I am writing a test code where by I need to check the actual physical memory on the linux system. But I am not able to find the command for that. The linux commands like free, or /proc/meminfo or dmesg | grep Memory only show the physical memory available to linux but not the ACTUAL RAM available on system.
For example, my system has 2GB of RAM and I provide only 512 MB to linux (using mem=512MB command in the grub file). So when I use any of the above commands to see the physical memory they show me 512 MB and not 2GB!

Reading mtrr contents looks like a good option but I am not very sure if it will give correct data on all the systems. Can someone help me?
 
Old 08-14-2006, 08:14 PM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,191

Rep: Reputation: 49
by specifying mem=512MB in grub, your telling grub that "there is no need for you(grub) too find out the total memory, I tell you the memory is 512MB."
So, after that it doesnt bother to search for the total memory. I dont think you will be able to find the total physical ram.

why would want to restrict the mem to 512MB anyway?
 
Old 08-15-2006, 01:22 PM   #3
bhavishya_goel
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by w3bd3vil
by specifying mem=512MB in grub, your telling grub that "there is no need for you(grub) too find out the total memory, I tell you the memory is 512MB."
So, after that it doesnt bother to search for the total memory. I dont think you will be able to find the total physical ram.

why would want to restrict the mem to 512MB anyway?
Thanks for your reply. I have got a card installed on my pci slot. The firmware running in that slot needs around 1.5 GB of system RAM to operate and thats why I have to restrict the mem to 512 MB. Can I use MTRR file contents to check the physical RAM? It gives me correct figure for physical RAM but I am not sure if it will do so for every system.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow performance!!! System using a lot of Physical Memory SLOW HELP! badgerbox76 Linux - Newbie 31 07-19-2007 10:23 AM
Information for virtual memory file system peiwai Linux - Software 1 05-01-2006 12:09 PM
Less physical memory? ariek Debian 5 07-21-2005 02:23 PM
get Physical memory in C/C++ Dreampainter Programming 1 10-30-2004 08:54 PM
How Much Physical Memory ? tied2 Linux - Newbie 3 06-17-2002 01:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration