Beruflich Dokumente
Kultur Dokumente
Systems
AIXPerl
Adde d by O neSk yW a lke r, la st e dite d by O neSk yW a lke r on Fe b 17, 2011 (vie w cha nge)
La be ls: (None )
export LDR_CNTRL=MAXDATA=0x80000000 5
and run the failing Perl script again to confirm that it does not fail. If the Perl script still fails, the maxdata setting
is not causing the failure and the issue is likely with ulimits or a shortage of paging space.
Please note that the LDR_C NTRL setting above can cause issues for other executables, so running with
LDR_CNTRL set by default is not a good idea.
The AIX ldedit command can be used to patch the Perl executable to change the maxdata setting with which it
is run.
perl5.8.8.patched:
ibm.com/developerworks/…/AIXPerl?de… 1/4
3/2/2011 AIXPerl - Wikis
***Object Module Header***
# Sections Symbol Ptr # Symbols Opt Hdr Len Flags
{{ 5 0x00010eec 3022 72 0x1002}}
Flags=( EXEC DYNLOAD DEP_SYSTEM )
Timestamp = "Jun 02 03:13:37 2009"
Magic = 0x1df (32-bit XCOFF)
***Optional Header***
Tsize Dsize Bsize Tstart Dstart
0x00001da8 0x00000630 0x00000008 0x10000150 0x20000ef8
perl5.8.8.patched:
***Optional Header***
Tsize Dsize Bsize Tstart Dstart
0x00001da8 0x00000630 0x00000008 0x10000150 0x20000ef8
When a 32-bit executable is compiled without maxdata, the executable's stack and data is restricted to a single
256 MB segment. Setting maxdata to 0x80000000 lifts the 256 MB restriction to 0x80000000 = 2147483648 bytes
= 2 GB, or eight 256 MB segments.
ibm.com/developerworks/…/AIXPerl?de… 2/4
3/2/2011 AIXPerl - Wikis
= 2 GB, or eight 256 MB segments.
BTW, the Getting more memory in AIX for your Java applications article has a good explanation of how maxdata
works and what it does. In the article, see Figure 1 and the text which precedes and follows it.
Another option is to run the 64-bit version of Perl, but please note that the same Perl script will consume
more virtual and real memory when run with the 64-bit version of Perl. To use the 64-bit version of Perl, change
the hash-bang line (the first in the shell script) to point to the 64-bit executable. For example:
#!/usr/opt/perl5/bin/perl5.8.8_64bit 5
My thanks to C hris Shortes (Jay C Shortes/Dallas/IBM) for pointing out that the maxdata setting overrides soft
ulimits and that AIX does not enforce the memory ulimit.
So, when running versions of Perl compiled without maxdata (the 64-bit version is typically compiled
without maxdata), it is often necessary to alter the default data ulimit:
isdtest1# ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000
threads(per process) unlimited
processes(per user) unlimited
isdtest1#
In the example above, the data ulimit will restrict Perl compiled without maxdata to 131072/1024 = 128 MBs.
time(seconds) unlimited
ibm.com/developerworks/…/AIXPerl?de… 3/4
3/2/2011 AIXPerl - Wikis
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 2097152
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000
threads(per process) unlimited
processes(per user) unlimited
isdtest1#
Be careful
Don't use ulimit -d 2097152, which will change the hard data ulimit. When the hard
data ulimit is changed on a userid other than root, it can only be changed to a value
lower than the current hard data ulimit. Always specify the -S flag to set the soft
ulimit. If a hard ulimit is inadvertently reduced to a value which is too low, log off and
log back on again. The new shell will revert to the default hard ulimits.
The contents of this web page solely reflect the personal views of the authors and do not necessarily
represent the views, positions, strategies or opinions of IBM or IBM management. Please use the Add
C omment link at the bottom of the page to provide feedback. Note: Until you sign up and log in (using links in the
upper right corner of this web page), you will not see the Add C omment link and you can not add a comment.
P owe re d by Atlassia n C onflue nce , the Enterprise W ik i. (Ve rsion: 2.3.3 Build:#645 Feb 13, 2007) - Bug/fea ture request -
C ontact Adm inistra tors
ibm.com/developerworks/…/AIXPerl?de… 4/4