Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is my Java process running 32 or 64bit? Solaris

Posted on 2008-06-23
4
Medium Priority
?
8,502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

618 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