Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

64 Bit PERL Scripts limit in AIX 1

Status
Not open for further replies.

xenon79

Vendor
Dec 11, 2006
7
0
0
MY
Hi,

I face problem when running my perl scripts. My hardware and kernel is 64 Bit, and the perl install is also 64 Bit.
but I got out of memory error whenenver the scripts used 2Gb of memory.

I found this out using ps vg (PID of my perl scripts).

ulimit -a shows

data(kbytes) unlimited

so this should not be a problem.

Anyone have faced the same problem before?
 
This might not be helpful, but i remember back when i was programming in c that there was limits you set at the beginning of the program, is there such limts in your code?

Regards,
Khalid
 
Hi,

thanks for your response.
there are no limits define in my scripts.
is there any know limitation of perl scripts can only use 2GB of memory

 
Have you tried to set memory to unlimited?

time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 32768
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 2000


Regards,
Khalid
 
Hi,

When I do ulimit -a in shell it shows as unlimited.
but when I do ulimit -a in perl it shows as 2GB.
Anyone knows how to change the ulimit setting for perl?

Regards
 
IMHO I think you can use the following command:

Code:
# ! /usr/bin/perl

system("ulimit  -m unlimited");

Regards,
Khalid
 
Hi,

I have tried the following:

system("ulimit -a");
system("ulimit -d 4194304");
system("ulimit -a");

and here is the output i get.

time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 2097152
stack(kbytes) 4194304
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 32000

time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 2097152
stack(kbytes) 4194304
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 32000

It seems the output of ulimit -a before and after i run the ulimit -d is still the same.

 
Still looking into that and i found this:

Code:
When compiling large C or FORTRAN programs, you may receive a MALLOC error during the link phase. This is because their is not enough heap space allocated to this process.

Do you recieve the above error?

Got this from:


Regards,
Khalid
 
What is the symlink /usr/bin/perl pointing to. Per default (after installation) it links to the 32bit perl.

Try your script with /usr/opt/perl5/bin/perl_64bit.

You may switch to perl64bit by running the script (as root) /usr/opt/perl5/link_perl_64. Switch back to 32bit with the script /usr/opt/perl5/link_perl_32.


HTH,

p5wizard
 
Hi p5wizard,

I'm not using the perl from /usr/bin/perl

this is the output of my perl -V

./perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=aix, osvers=5.3.0.0, archname=aix-64all
uname='aix ramses 3 5 00c39e4d4c00 '
config_args='-Dprefix=/opt/perl5.8.8'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -q64 -DUSE_64_BIT_ALL -q64',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN'
ccversion='7.0.0.9', gccversion='', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags ='-brtl -bdynamic -bmaxdata:0x80000000 -L/usr/local/lib -q64 -b64'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lc -lbsd
perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc -lbsd
libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -bE:/opt/perl5.8.8/lib/5.8.8/aix-64all/CORE/perl.exp'
cccdlflags=' ', lddlflags='-b64 -bhalt:4 -bexpall -G -bnoentry -lc -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT
USE_LARGE_FILES USE_PERLIO
Built under aix
Compiled at Feb 26 2008 23:35:49
@INC:
/opt/perl5.8.8/lib/5.8.8/aix-64all
/opt/perl5.8.8/lib/5.8.8
/opt/perl5.8.8/lib/site_perl/5.8.8/aix-64all
/opt/perl5.8.8/lib/site_perl/5.8.8
/opt/perl5.8.8/lib/site_perl

Any helps really appreciated.

Regards
 
Well, in /usr/opt/perl/bin/perl and perl_64bit I get this:

[tt]# ulimit -d unlimited
# ulimit -m unlimited
# ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) unlimited
stack(kbytes) 32768
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 2000
# cat test.pl
system("ulimit -a")
# /usr/opt/perl5/bin/perl test.pl
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) [red]2097152[/red]
stack(kbytes) 32768
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 2000
# /usr/opt/perl5/bin/perl_64bit test.pl
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) [blue]unlimited[/blue]
stack(kbytes) 32768
memory(kbytes) unlimited
coredump(blocks) 2097151
nofiles(descriptors) 2000[/tt]

So it does have a different behaviour from your perl...

And this is my -V output for perl_64bit (spot the differences):

[tt]# /usr/opt/perl5/bin/perl_64bit -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=aix, osvers=5.2.0.0, archname=aix-thread-multi-64all
uname='aix animals 2 5 000709cf4c00 '
config_args=''
hint=previous, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc_r', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q64 -DUSE_64_BIT_ALL -q64',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT'
ccversion='5.0.2.0', gccversion='', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags ='-brtl -b64'
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc_r -lbsd
perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc_r -lbsd
libc=/lib/libc.a, so=a, useshrplib=true, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:/usr/opt/perl5/lib64/5.8.2/aix-thread-multi-64all/CORE/perl.exp'
cccdlflags=' ', lddlflags='-b64 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc_r'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
SUIDPERLIO1 - fix PERLIO_DEBUG buffer overflow (CAN-2005-0156)
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
Built under aix
Compiled at Jan 27 2006 11:07:15
@INC:
/usr/opt/perl5/lib64/5.8.2/aix-thread-multi-64all
/usr/opt/perl5/lib64/5.8.2
/usr/opt/perl5/lib64/site_perl/5.8.2/aix-thread-multi-64all
/usr/opt/perl5/lib64/site_perl/5.8.2
/usr/opt/perl5/lib64/site_perl
.
[/tt]


HTH,

p5wizard
 
Hi p5wizard,

It was good to hear that someone has an environment that the 64 Bit perl has the data segment set to unlimited for perl.

Will it be possible for you to provide me the steps on how your perl was install.

Really appreciate your help.

Regards
 
My perl was installed during system installation, from AIX CDs I guess:

[tt]# oslevel -s
5300-05-05
# lslpp -l perl.rte
Fileset Level State Description
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
perl.rte 5.8.2.50 COMMITTED Perl Version 5 Runtime
Environment[/tt]



HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top