LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-18-2010, 07:07 AM   #1
wagaboy
Member
 
Registered: Jun 2010
Distribution: Ubuntu 10.04, Cent OS 5.5, CLE3
Posts: 51

Rep: Reputation: 21
why is process's maximum virtual memory size limited to 1.2GB on PPC64


Hi !

I'm required to find a process's maximum virtual memory size in Linux on several architectures(x86, PPC, MIPS, etc.,), i.e., how long before malloc() inside an infinite loop fails ? I have written a code to test it(see the code below). Running this and finding the maximum virtual memory size is easy. Now for the tough part -- I need to explain the reason for this limit. I found that 3GB is the limit for x86. I badly want to know why 1.2GB is the limit for powerpc.
Code:
    void *mem;
    while (1) {
        mem = (void *) malloc(1024 * 1024); //1MB
        if  (!mem) {
            dump_mem_info(); //collects memory related information.
            break;  
    }

After a bit of searching on the internet, I could find the following factors limiting the process's maximum virtual memory size:
1. 3GB/1GB user/kernel virtual memory address split for a 32 bit machine.
2. Process resource limits which is modified by "ulimit" cmd
3. By configuring /etc/security/limits.conf

After testing a 32-bit x86 system, I found that the malloc fails at 3GB. Ulimit is unlimited and limits.conf is not set. So 3GB user virtual memory address is the limit.

For the 32 bit powerPC system, ulimit is unlimited and limits.conf is not configured, but the malloc always fails at 1.2GB. What could be the reason for this limit ? Are there any configuration files/ commands that let me find this limit without running my code. I have already tried:
Code:
free -m
pmap <pid>
cat /proc/<pid>/status
cat /proc/meminfo
But none of the above indicate the 1.2GB limit.

Thanks in advance !
WB
PS: I'm aware of optimistic memory allocation in linux, which allows malloc'ing more memory than the physical memory available as long as none of the malloc'ed pages are referenced.
 
Old 06-18-2010, 03:42 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,880

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Sounds like a question for the LMKL. The guys writing the kernel will know
 
Old 06-26-2010, 05:21 AM   #3
wagaboy
Member
 
Registered: Jun 2010
Distribution: Ubuntu 10.04, Cent OS 5.5, CLE3
Posts: 51

Original Poster
Rep: Reputation: 21
I couldn't find a reason for the upper limit, but doing
Code:
dmesg | grep Memory
showed that highmem is 1.3GB. I guess this has something to do with the upper limit which is close to the maximum memory that I can malloc
 
Old 06-26-2010, 07:50 AM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192Reputation: 1192
Quote:
Originally Posted by wagaboy View Post
I'm aware of optimistic memory allocation in linux, which allows malloc'ing more memory than the physical memory available as long as none of the malloc'ed pages are referenced.
But the default settings for that do not allow a single process to malloc more than the total swap space plus some big fraction of ram. Multiple processes combined can malloc much more. But each process is limited to roughly an amount it could actually use assuming none of the others use any of the memory that they have already malloc'ed but not used.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 05:05 AM
ReiserFS 2Gb maximum file size limit? Cannot copy files bigger than 2Gb ihtus SUSE / openSUSE 2 10-26-2007 10:21 AM
tar backup maximum 2gb only per tape tsaravan Linux - General 6 09-20-2006 07:45 AM
Partition sizes limited to 2GB kitaru2004 Linux - General 16 12-25-2005 02:34 PM
Can't recognize more than 2gb harddisk size ericmacau Linux - General 2 09-23-2003 10:15 PM

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

All times are GMT -5. The time now is 01:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration