jvm

java jre confusion

Could anyone please tell how jre directory help in the running java programs? I'm calling java interpretor by using java command, and that is in JDK directory, then how could jre directory help in running java programs and jdk for compiling? ...

Generating heap dump from Java code

Hi, I'm trying to programm a self destruction logic. I've already created a global ExceptionHandler which will be processed in some cases. I want to collect some system information before the destruction. One information should be the current heap dump. I found The following page http://blogs.sun.com/sundararajan/entry/programmatically_...

Force full garbage collection when memory occupation goes beyond a certain threshold

I have a server application that, in rare occasions, can allocate large chunks of memory. It's not a memory leak, as these chunks can be claimed back by the garbage collector by executing a full garbage collection. Normal garbage collection frees amounts of memory that are too small: it is not adequate in this context. The garbage coll...

JVM memory initializazion error after windows update

Hi all, I have three Windows Server 2003 with 2 GB RAM. Server1 tomcat 5.5.25 jvm version SUN 1.6.0_11-b03 Server2 tomcat 5.5.25 jvm version SUN 1.6.0_14-b08 Server3 tomcat 6.0.18 jvm version SUN 1.6.0_14-b08 For the three servers JVM parameters are: -XX:MaxPermSize=256m -Dcatalina.base=C:\Apache Group\apache-tomcat-5.5.25 -Dcata...

How to use separate class loaders and run in same JVM? (OSGI)

I've read that OSGI uses separate classloaders per module which allows modules to use different versions of their dependencies.. while at the same time running all modules in the same JVM. How does this work? If module A uses version #1 of a dependency and module B uses version #2, won't you run into trouble if module A passes an inst...

32-bit versus 64-bit JVM performance considerations?

Our production environment runs 3 32-Bit Java 6 JVMs on each Windows 2003 server. Each heap is at it's max setting (~1.25GB). We are considering moving to new servers and using 64-Bit JVMs. Presumably we can then have one 64-bit JVM on each server that would replace the 3 32-Bit JVMs on each server because of the allowance for a much lar...

Understanding max JVM heap size - 32bit vs 64bit

I've read the max heap size on 32bit Windows is ~1.5GB which is due to the fact that the JVM requires contiguous memory. Can someone explain the concept of "contiguous memory" and why you only have max 1.5GB on Windows? Secondly, what then is the max heap size on 64 bit Windows and why is this different than what's available on 32 bit?...

Is there a way to turn on some sort of JVM logging so I can see whats happening during classloading etc.

I'm trying to optimize the startup time/class loading time of my Java web app because its on the Google App Engine and startup time is important. Is there a way I can turn on some sort of class loading debug messages or someway to see where time is being spent while class loading? I want to see if any specific libraries take a while to...

Automated testing in Android development

I have an ordinary project with JUnit tests that are connected to the classes in my Android Project. I want my server to run some JUnit tests in my testproject everytime I commit my code from my Android Project. Is there a best practise to do this? So far I only managed to run the tests when they are a part of a while the JUnit tests a...

JVM version manager

Is there Ruby Version Manager equivalent for the Java world? I'm looking for tool which allow me to easily download and install a new JVMs and switch between them. For example: jvm install <version> jvm list //will list installed JVMs on my system jvm use jdk1.6 //will switch my env to jdk 1.6 version, etc. ...

Running multiple jvms for different applications in same machine

We are getting frequent out of memory errors in our dev. machines We are running webshpere, eclipse, soap UI and maven in it. Our server gets down due to this "out of memory errors" when we restart our applications in websphere 2/3 times, We already increased the virtual memory setting in wesphere to 1GB. So what i did was copied the jr...

Class initialization issues loading java.util.logging.LogManager in Android Dalvik VM

I've done changes in an Android native library and installed a new system.img file but am now getting an unrelated Error on startup. I can get past it by swallowing the error but I wanted to know if anyone can explain what the issue is. The Android implementation of Logger.java claims that it is Forcing the LogManager to be initialized ...

tomcat isolate webapps

multiple webapp running on same tomcat using same jvm. sometime, one webapp that have memory leak will cause entire jvm to crash and affect other webapps. any recommendation how to isolated that without need to use multiple jvm and tomcat ...

Why does the the Java VM not recover after "Too many open files" errors?

In certain well-understood circumstances, our application will open too many sockets (database connections) and reach the maximum open files that the OS allows. We understand this; we are fixing the issue and also bumping up the limit. What we can't explain is why parts of our application don't recover even after the number of connectio...

How to set a JVM Timezone Properly

I am trying to run a java program, but it is taking a default GMT timezone instead of a OS defined timezone. My jdk version is 1.5 and the OS is Windows Server Enterprise (2007) Windows has a Central timezone specified, but when I run the following program, it gives me a GMT time. import java.util.Calendar; public class DateTest { ...

Memory leak of java.lang.ref.WeakReference objects inside JDK classes

The following simple code reproduces the growth of java.lang.ref.WeakReference objects in the heap: public static void main(String[] args) throws Exception { while (true) { java.util.logging.Logger.getAnonymousLogger(); Thread.sleep(1); } } Here is the output of jmap command within a few seconds interval: user@t1007:~> jmap -d64 -hi...

java virtual machine

Is jvm software based? If so in which language is jvm coded? ...

JVM (embarrasingly) parallel processing libraries/tools

I am looking for something that will make it easy to run (correctly coded) embarrassingly parallel JVM code on a cluster (so that I can use Clojure + Incanter). I have used Parallel Python in the past to do this. We have a new PBS cluster and our admin will soon set up IPython nodes that use PBS as the backend. Both of these systems mak...

Is this error caused by a 64-bit library being accessed by a Java program running in a 32-bit JVM?

I'm trying to create a simple Java app that uses JNI to call some native functions. I've followed the examples in the JNI Programming Guide and can't seem to get them to work. I have the following Hello World program, written in Java: class HelloWorld { private native void print(); public static void main(String [] args) { ...

How do JVM's implicit memory barriers behave when chaining constructors?

Referring to my earlier question on incompletely constructed objects, I have a second question. As Jon Skeet pointed out, there's an implicit memory barrier in the end of a constructor that makes sure that final fields are visible to all threads. But what if a constructor calls another constructor; is there such a memory barrier in the ...