• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Profiling - Heap & GC between Linux and Windows

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I was trying to profile as well as evaluate different versions of Java for my app.
Started the app with '-Xms 100 -Xmx 300' on windows. With JDK 1.4 with a few transactions, this memory was used up and GC had to kick in. This repeats with transactions.
Switched to JDK 1.5. This time, even with lot of transactions, the heap mem used stayed below 10M! And you could see partial GC kicking in at times.

This proved a considerable improvement. Hence thought of trying this out on Linux, which is my deployment environment.
Started the app with '-Xms 100 -Xmx 300'. But this time, on both JDKs with a few transactions, this memory was used up and GC had to kick in. This repeats with transactions!

I wonder why the significant performance difference is not showing in Linux?

Apart from -Xms and -Xms I am not using any other VM options. Any insight is helpful.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sudatta, welcome to Java Ranch!

Are you sure that you were running the 1.5 JVM on Linux? It should run the same on Windows and Linux (there are platform differences, but not any that I know of in the heap management area).

Try adding the -showversion option to the command line to ensure you are running the version you think you are.
 
Sudatta Gautham
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter

On Linux Adding -showversion shows

JProfiler> CPU profiling enabled
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

On Windows
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode)

So linux is using "Mixed mode, sharing" and Windows is using just "mixed mode". That is the only difference.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are running different versions - update 6 on Linux and update 16 on Windows.
 
Sudatta Gautham
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good catch!
So I tried running the same test on Windows with JDK 1.5.0_06. I still see the same performance improvement as that of 1.5.0_16-b02.

JProfiler> CPU profiling enabled
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
JProfiler> Hotspot compiler enabled

Another critical difference that I forgot to mention earlier is in case of windows I am starting my app THROUGH Jprofiler. For Linux it is remote-integrated. I have also posted a question to Jporfiler to see if they have anything to say on this.

Thanks
Gautham
 
Sudatta Gautham
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just another interesting update. I tried to see if this could be a problem with they profiling tool is running/controlling the VM. I repeated the exercise on Jprobe. This time on both JDK 1.4 and 1.5 the app memory stayed below 10 MB!!!

I will try running app as remote app and try again.
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic