• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java on Linux  RSS feed

 
Prabu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Any one knows the difference between Green threads and native threads on Linux?
I am working with Java IDEs (Forte CE and JBuilder4 foundation) on Red Hat 7.0, I found IDEs crash very soon.
My system is PIII 450 MHz with 128MB RAM
(So, it is not a bad system- because I have tried Win2000 server, Solaris 8.0 intel version - on different hard disks).
Java's performance on Win 2000 server and Solaris was wonderful.
But on linux it sucks.
I develope applications with JBoss - Tomcat - Apache with cloudscape 3.6 db (Ofcourse, heavy use of jvm ).
Recently I talked to a Sun's java evangelist in a J2EE code camp.
He says somthing to do with Green thread and native thread difference.
Does any one has idea about this or knows how to optimize java's performance on Linux?
How about java's performance on FreeBSD? Any experience?
Thanks in advance.
Prabu
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Prabu",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't indicate which JVM you are using.
By default RedHat 7 ships with the very slow and clunky "Kaffe" JVM ( run java -version to see which you are really using. ) If you are still running Kaffe, I strongly recommend removing it using rpm, and then installing one of the more effective JVMs. Typically Kaffe is 4-10 times slower than Sun's 1.3 JVM, for example!
Either the Sun or Blackdown 1.2 or 1.3 JVMs should give you good performance. The IBM one is sometimes faster, but not so stable, particularly under heavy server-side use. Some people have reported occasional odd problems with the Sun 1.3 VM, but it has worked fine for me so far.
 
Prabu Swami
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
I have changed my UserName as Prabu Swami as per Javaranch name conventions. I am a new member, just joined today and surprised by this wonderful site.
Well about jdk, i am using sun's jdk 1.3 HotSpot Client VM.
(should i change to HotSpot Server VM? )
Already i removed Red Hat's default jvm and configured for this jdk1.3.
Also i have noticed that java threads create new process in Linux. (why? aren't they green threads on same jvm? )
Did you experience this?.
Prabu Swami
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for choosing a new name. We do appreciate it.
As for the "extra processes", it's a wierdness of Linux. When you use native threads on Linux, it actually uses a special lightweight process model to represent them, so the threads show up in the the likes of "ps". Don't worry, they are just threads, altough it can be hard to tell which ones are the "real" processes. If you use "green" threads, they will be implemented by the JVM in a single native process, so you won't see any extra processes.
As for why your application seems so slow, I don't know. Although the server VM is a little better at long-running tasks, it's not usually very noticeable. Is your application likely to be constrained by something else -- is it network or IO bound, for example ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!