Permanently set maxdata to maximum


 
Thread Tools Search this Thread
Operating Systems AIX Permanently set maxdata to maximum
# 1  
Old 09-08-2015
Permanently set maxdata to maximum

Hi,
I've a 32-bit program running on AIX. By default the memory limit of the process is 256 MB as per the 32-bit AIX OS behavior. This can be changed using the LDR_CNTRL=maxdata environment variable. Baseed on the value that we set in terms of increments of segments the process can consume more memory when required.
During compile time also this can be set using "-bmaxdata:0x80000000" which would increase the max memory limit to 2.25GB. The question that I have is, is it OK to do do this max memory setting on my program? Are there are limitation/issues due to this?
Would appreciate if I could get the details.

Thanks'n Regards
-KPRajesh
# 2  
Old 09-08-2015
The only fair answer is "It depends" on what the application needs.

FYI: you can also use the program ldedit to change this value. Something else I would recommend is to change the default page size from 4k to 64k.

p.s. when I am back from vacation I will add links to on line documentation - unless someone else beats me to it.
This User Gave Thanks to MichaelFelt For This Post:
# 3  
Old 09-09-2015
Thank you Michael for the quick reply.
In the case of my binary, the amount of memory that is consumed will increase when the load on it goes high. So I thought of setting the maximum memory. So was wondering if this idea is good. Please suggest.
Michale when you said "It depends", could you please be elaborate?

ps: I'm aware of using ldedit as well.

-KPRajesh
# 4  
Old 09-09-2015
Mainly, it depends on how much memory you have in the system, aka partition or virtual machine. note also 0x80000000 is not the maximum (hope i am getting all the zeros right). From memory, it is now up to 13 segments you can use (increase by 12, as one is for kernel, one for code (that too can be increased by one if i recall correctly), and one for device drivers and shared library code and data.

What you lose is segments that are easily shared by programs. However, to minimize that their is an additional setting, but i do not recall that (i.e., i must refer to documentation i do not have handy).

If you do not know it already I recommend you learn to use svmon to monitor how your program is using memory, and hopefully not paging space.

In short, if you are also using shared memory for anything, and you have enough free memory for the process, there should be little to worry about.
# 5  
Old 09-09-2015
The amount of memory available on the system varies from 256MB to 4GB. This is because customers using my program has systems with different memory sizes.

1) I have a clarification to understand the AIX mem mgmt behavior. Suppose that I do not set the LDR_CNTRL=maxdata flag in which case my program can use max. of 256MB, right? Now say my program has done malloc/calloc and reached 256MB. If my program again wants more memory using calloc/malloc, what happens? Will it get addtional memory after some memory are swapped to swap space? And if no swap space is available I guess it would cause SEGV.

2) When you said "using shared memory ..." what did you mean?

3) The additional option, is it MALLOCOPTIONS=disclaim? We've tried this but makes the process very slow. Any other option?

Thanks
-KPRajesh
# 6  
Old 09-11-2015
about to board a plane. later.
# 7  
Old 09-13-2015
After many hours of travel, and some sleep I have for you - this link with the basis information: https://www-01.ibm.com/support/knowl...rg_support.htm

Basically, what happens is that system and code remain in segments 0 and 1.
When maxdata is not equal to 0 (zero) - which is default, segment 2 is used for the stack and application .data (pre-initialized data) and .bss (aka heap for malloc calls) start in segment 3 and continue for the number of segments specified.

As you mentioned in your initial question the "official" large memory support model has a maximum MAXDATA value of 0x80000000 - so that is 2.25 G total (256MB (roughly) for the stack, and 2 GByte (8x 256 MByte) for application .data and .bss

From the discussion, I do not think you will want to use the DSA - dynamic segment allocation - option (so-called or the VERY large memory option). However, if 2G Byte for .data and .bss is not going to be enough you may need to use that.

Back to "shared" memory - the default memory model setup uses only segments 0, 1, and 2 for the memory model - the segments there are 12 segments (numbers 3-12 and 14 are used by shmap or mmap routines). Historically, segments 13 and 15 were used by global shared libraries text and data. When you use the DSA option global shared libraries are not used - instead the shared libraries are loaded "privately" into segment 15 - both text and data. This free up segment 13 giving an application at least one additional segment.

If you are not using shmap or mmap routines then the "very large" model should work fairly easy. However, if you do use either of these routines they may impact the maximum memory available via malloc(). - keyword here: potential impact!

I hope this answers your question well enough.

Michael
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Cannot set 'soft limits' for 'maximum stack size' for a standard user

Hi Guys, I'm trying to install Oracle Database on to Oracle Linux 7.6 but when the database install package checks the OS set-up, it keeps on failing on the soft limits for the stack. It's default value is 8192 but I'm trying to set it to 10240. This is what I added to... (2 Replies)
Discussion started by: ASGR
2 Replies

2. Solaris

Set autolist permanently

Hi , How to set autolist permanently in Solaris 10 (2 Replies)
Discussion started by: ankit.padhiyar
2 Replies

3. UNIX for Dummies Questions & Answers

Set maximum memory for user

Hi, I have as Solaris 10 (x86) system. I want to set the maximum memory for the user But the following comaand is valid only till next reboot.Pls let me know how to make it permanenent. prctl -n project.max-shm-memory -r -v 4G -i project 3 (6 Replies)
Discussion started by: Rossdba
6 Replies

4. Red Hat

Change service name permanently

Hi, Since everything is doable in Linux so far, what is the ability of changing a spicifc service name permanently. e.g. I want to change the network service name to connection, so I can use chkconfig command as follow: chkconfig connection off --level 5 # for disabling network service in... (7 Replies)
Discussion started by: leo_ultra_leo
7 Replies

5. UNIX for Advanced & Expert Users

gmail revert to old look permanently

I thought I would share gmail revert to old look permanently. I am sure I am not the only one annoyed by the new look. Install Stylish extension Choose the Stylish UserStyle that you want. I know The Return of Old Gmail and gmail-b2b both work but I prefer gmail-b2b since I think it looks... (0 Replies)
Discussion started by: cokedude
0 Replies

6. Red Hat

set device mode permanently with udev rule

On a test server running CentOS 6, I try to permanently set the owner, group and mode of disk devices for use with a DB2 database. For this I created an udev rule file /etc/udev/rules.d/99-db2.rules: KERNEL=="sdb*", OWNER="db2usrl1", GROUP="db2adml1", MODE="0600" After a reboot, the owner and... (4 Replies)
Discussion started by: hergp
4 Replies

7. Solaris

How do i permanently set bash profile??

Hi all, I don't want to enter below command on solaris every time. How do i permanently set this command on Solaris. I know that this operation is a piece of cake on redhat because there is a /etc/rc.local file on it. But Solaris ???? bash-3.00#export PS1="\e (2 Replies)
Discussion started by: getrue
2 Replies

8. Shell Programming and Scripting

lynx browser set permanently option

hi all, is there somebody that know how can I set an permanently option for the lynx text browser? The reason is if I open some URL's and type my login infos then lynx show follow message: P)roceed, use G)ET or C)ancel Server asked for 301 redirection of POST content to URL: The UNIX... (1 Reply)
Discussion started by: research3
1 Replies

9. AIX

I can not increase the maxdata to 2 G.B

Please can anyone help me in my problem my problem is i have AIX 5.3 and We need 1 GB of data segment size available and we found To set the data segment size to 1 GB, set the LDR_CNTRL variable to LDR_CNTRL=MAXDATA=0x40000000@DSA. But after we set it and check with command “$ dump -X64 -o... (0 Replies)
Discussion started by: mghazaly
0 Replies

10. UNIX for Dummies Questions & Answers

compatibilty with MAXDATA machines

hi, I'm thinking of buying a Maxdata laptop 3100x. Only problem is that I'll need to run LINUX on it, and I've been warned that some machines don't run UNIX due to problems with their graphics cards. I contacted Maxdata, who say they've never tested their machines for UNIX-compatibility, which... (1 Reply)
Discussion started by: perturbed
1 Replies
Login or Register to Ask a Question