Solved

Is my Java process running 32 or 64bit? Solaris

Posted on 2008-06-23
4
8,307 Views
Last Modified: 2013-12-27
Hi,
In windows, I can tell if a processes is 32 or 64 by looking @ the processes in the taskmgr, and if a process has *32, then its 32bit.

How can i see if a process is 32 or 64 in solaris?  This is what i see when i do java -d64 -version:

[home@HA-TS01 17:37:27 ~]$ java -d64 -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode)
[home@HA-TS01 17:37:31 ~]$

Is there a ways i can tell?
Thank you
0
Comment
Question by:XDanny322
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:blu
ID: 21850958
I am not sure what you are asking. Or rather, I thought I knew until you did the example execution with java. Obviously that JVM you ran in your example is running in 64 bits. Are you asking if how to tell if a currently running jvm is also running in 64 bits?
0
 

Author Comment

by:XDanny322
ID: 21851344
Maybe i was a bit confused when i asked.

Basically, i have a solaris x86 solaris 10 64bit system.  i have java both 32bit and 64bit installed. (this is because if you want 64bit java in solaris, you MUST have 32bit. http://www.java.com/en/download/help/5000010700.xml)

when i do java -version, this is shown:
[Danny@HA-TS01 19:39:34 ~]$ java -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode)
[Danny@HA-TS01 19:39:37 ~]$

when i do java -d64 -version, this is shown:
[Danny@HA-TS01 19:39:38 ~]$ java -d64 -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode)
[Danny@HA-TS01 19:39:53 ~]$

I assume that this tell me that when i do java -version, i am calling java 32bit.  And when i am doing java -d64 -version, i am calling 64bit.

Question is, in solaris, when is process is up, how do i know if its taking 32bit or 64bit JVM?

(in windows, you can pull up the taskmgr and see if the process has a *32 next to it, then its 32bit.  If not, then its 64bit.  This assume you have 64bit system, and O/S)

Hope the clear it up a bit? thx
0
 
LVL 22

Accepted Solution

by:
blu earned 500 total points
ID: 21851519
Okay, now I get it. There are two ways. One, is you can just to a "ps -f -p pid" (where pid is the process id of the process in question) and look to see if it says just "java" or if there is a long path that has "amd64" in it somewhere. The process at /usr/bin/java is 32-bits, but if the JVM wants to use 64-bits (like if you said -d64) it execs the java under the JDK in the amd64 directory.

The other way (and more sure) is to use the pflags command. Simply run "pflags pid" (same pid as before) and it will include a line at the top of the output that says "data model" which will have either a 32 or 64 in it somewhere.
0
 

Author Comment

by:XDanny322
ID: 21852530
Thanks Blu.

Now just to keep everyone else together, this is what i got from pflags

32bit process :
[danny@HA-TS01 23:54:54 ~]$ pflags 1984
1984:   /usr/jdk/instances/jdk1.5.0/jre/bin/java -Ddanny_TRADEMONITOR -DJIN
        data model = _ILP32  flags = ORPHAN|MSACCT|MSFORK
 /1:    flags = ASLEEP  pollsys(0x0,0x0,0x8042d48,0x0)
        sigmask = 0x00000004,0x00000000
 /2:    flags = DETACH|ASLEEP  lwp_cond_wait(0x8102048,0x81


64bit process
danny@HA-TS01 23:55:08 ~]$ pflags 1844
1844:   /usr/jdk/instances/jdk1.5.0/jre/bin/amd64/java -Ddanny_APPSERVER -D
        data model = _LP64  flags = ORPHAN|MSACCT|MSFORK
 /1:    flags = ASLEEP  lwp_cond_wait(0x42be60,0x42be48,0x0,0x0)
        sigmask = 0x00000004,0x00000000
 /2:    flags = DETACH|ASLEEP  lwp_cond_wait(0x42da50,0x42da38,0x0,0x0)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now