Operating System - HP-UX
1748123 Members
3180 Online
108758 Solutions
New Discussion юеВ

Re: Running 32 bit programs on 64 bit HP UNIX

 
Steven E. Protter
Exalted Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

Shalom,

This is an application problem not an OS problem. The OS is fully capable of running 32 bit applications.

The reason we have 64 bit OS and 64 bit applications is to get around these issues.

The problem is 32 bit Java and there is nothing that can be done, save for getting or writing applications that can use 64 bit Java.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Prem Mehrotra
Occasional Advisor

Re: Running 32 bit programs on 64 bit HP UNIX

I talked to some other folks in Java Forum. This apperas to be an OS issue, becasue in Osralis, Windows XP etc people can start mnay JVM's with 1GB or more as heap space. jvm is 32 bit.

For some reaosn HP UNIX is posing this limit even though it is 64bit OS. Majority of applications are still 32 bit, only db vendors such as Oracle have 64 bit. Even in Oracle, some command such rman etc still use 32 bit executables.
Dennis Handly
Acclaimed Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

>This appears to be an OS issue

You are confused. This is a sysadmin problem, you must first set maxdsiz to 4 Gb.

>For some reason HP-UX is posing this limit even though it is 64bit OS.

Only because you ordered it to do so.
Bill Hassell
Honored Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

32 bit programs will always been limited to less than 4 GB. This is common across most OS platforms. The problem is that the pointers simply aren't large enough. And mixing 64 and 32 bit programs, especially with shared memory can be a nightmare as the int sizes will not match.

There is nothing magic in a 64 bit OS. It can't make the program use more memory than it can address. You are using Java 32 bit and even with the MPAS model, you'll be limited to 32 bit addresses even with 256 GB of RAM -- which is not a limitation of the OS. You would have to recompile all the Java code to expand the address range. That is called 64 bit Java.

Note that Java is supplied in several executable models depending on how much memory you give thye Java engine at startup. There are EXEC_MAGIC, +q3p and +q4p versions which are selected by the startup command line. You must change maxdsiz to 4GB in order to use more than 1 GB. Also make sure that maxdsiz_64 is much larger. HP-UX will use the smaller of the two parameters for 32 bit programs. Use Glance to examine Java process for the actual heap memory being used.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

>Bill: 32 bit programs will always been limited to less than 4 GB.

That's not true in all cases. On PA-RISC, you can address 64 bits with space registers, long pointers, even in 32 bit mode. Of course you need OS support, MPE/iX.
Prem Mehrotra
Occasional Advisor

Re: Running 32 bit programs on 64 bit HP UNIX

Bill Hassell:

My question was not limited to a single 32 bit JVM which may be limited to around 4GB, but to all the JVMS's running on that system. When we have 64 bit address space, why can't each JVM can have its own 32 bit address space.

My UNIX Admin's have not yet changed maxdsiz parameter but most of the people seem to say 4GB limitation is for all the 32 bit programs combined on that server. I hope they are wrong.

The place where I work it is impossible to move from 32 bit java to 64 bit. We have 64 bit Oracle on the server, Oracle installs java in its own directories and chatr shows them to be 32 bit executables. I cannot alter that,

Don Morris_1
Honored Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

Each JVM does have its own address space. You're looking for a solution to a problem that doesn't exist. (In other words, "they" are completely and totally wrong.)

The limitations on 32-bit processes stem solely from:

1) maxdsiz, maxtsiz, maxssiz hard resource limits imposed via system administration
applied to the running process (and on v2 and beyond, the limit is what it was at the time of process execution since the limits can be altered dynamically).

2) Address space layout limits. [This is where the default of 2Gb private, 2Gb shared usually arises (with 1Gb of the 2Gb private being Text and the other Data, hence 1Gb - stack size for Heap). chatr or compilation flags allow for changing address space layout and I believe 32-bit IPF Java uses a wrapper to provide the appropriate one based on the heap argument supplied, but I'm not in user space often.

3) Reservable swap space. (If you can't make a virtual object, you won't get physical memory).

Now, you can get into interesting states with JVMs forked from other JVMs in that there's a certain amount of resource sharing via Copy-On-Access or Copy-On-Write algorithms, but the address spaces are still distinct.

Prem Mehrotra
Occasional Advisor

Re: Running 32 bit programs on 64 bit HP UNIX

Oh well, changing xamdsize did not make any difference:
#-> kctune -q maxdsiz
Tunable Value Expression Changes
maxdsiz 4294963200 4294963200 Immed

[root@psgtwq1:/stand]#
#-> kctune -q maxdsiz 64bit
Tunable Value Expression Changes
maxdsiz_64bit 4294967296 4294967296 Immed

My server has 9.5GB free memory, still when I eneter command java, I get message:
java

Exception java.lang.OutOfMemoryError: requested 524288 bytes for card table expansion. Out of swap space?
Possible causes:
- not enough swap space left, or
- kernel parameter MAXDSIZ is very small.
Java out of memory messages are marked with pid: 12817 in /var/adm/syslog/syslog.log.
Abort


Steven E. Protter
Exalted Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

Shalom,

There is a concept called memory windows which permit more than 4 gb of memory to be accessed by a program. Perhaps Java is not configured to use them, however even with memory windows no single memory segment can be allocated to exceed 4 gb. Might be less, I'm not an expert in this area of programming.

I don't however know why you are surprised at the 4 gb limit. The reason systems and software went to 64 bit was created over the past 10 years to get around these limitations.

You will have to adjust your application or port to 64 bit to get around this. Free memory on the system could be 100 or 200 GB and this limitation would not change.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: Running 32 bit programs on 64 bit HP UNIX

>My server has 9.5GB free memory, still when I enter command java

In case it isn't obvious, if you want a 64 bit java, you need to use the -d64 option.