LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-21-2008, 02:42 PM   #1
vlyamtse
Member
 
Registered: Apr 2007
Posts: 54

Rep: Reputation: 15
memory utilization questions


Hello,
I am trying to measure memory available for "malloc" in my application.
From /proc/meminfo I have the following:

MemTotal: 1035372 kB
MemFree: 117488 kB
Buffers: 79140 kB
Cached: 499216 kB
SwapCached: 0 kB
Active: 511768 kB
Inactive: 360340 kB
HighTotal: 130744 kB
HighFree: 252 kB
LowTotal: 904628 kB
LowFree: 117236 kB
SwapTotal: 2048276 kB
SwapFree: 2048276 kB
Dirty: 96 kB
Writeback: 0 kB
Mapped: 388224 kB
Slab: 30412 kB
CommitLimit: 2565960 kB
Committed_AS: 636504 kB
PageTables: 3160 kB
VmallocTotal: 106488 kB
VmallocUsed: 3676 kB
VmallocChunk: 102336 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 4096 kB

I have very similar result from the "sysconf", however RedHat System Monitor reports used memory as 360M off ~1G, so they report "Inactive" memory as free...
Which one I should use as a limit for "mallocs" in my process, so that it
wouldn't "overrun" the system? E.g. does "malloc" allocate from "Vmalloc total", or from "Inactive"?
Thanks,
-V
 
Old 10-22-2008, 08:10 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Looking at that, looks like you've got 1GB RAM, 2GB swap.
That would be the absolute max, but you'd have to allow some RAM for the OS, assuming no other user processes in use.
At a rough guess, anything over 750MB and it'll start digging into swap, which will slow everything down.
Consider carefully just how much you need at any one time.
 
Old 10-23-2008, 08:52 AM   #3
vlyamtse
Member
 
Registered: Apr 2007
Posts: 54

Original Poster
Rep: Reputation: 15
follow up

Why 750M, and not Committed_AS: 636504 kB?
Similar question: what is the largest size of memory I can allocate at once? Also 630M?
Thanks,
-V

Last edited by vlyamtse; 10-23-2008 at 08:54 AM. Reason: elaborate
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Detailed Memory Utilization manoj.linux Linux - Enterprise 1 05-06-2008 03:45 PM
general memory utilization Tylerious Linux - General 5 09-01-2005 01:25 PM
cpu and memory utilization laxmi_cs Linux - General 2 08-29-2005 04:06 PM
High memory utilization dav7500 Linux - General 7 03-05-2004 05:07 PM
Memory Utilization Question toddclark Linux - General 1 11-04-2000 06:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:15 AM.

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