jvm

java reflection call methods of an already loaded object

Hi, How can I call the method of an object that has already been loaded in the JVM using reflection? I tried Class myClass = Class.forName("myClass"); Method m = com.test.class.getDeclaredMethod("getValue",new Class[] {}); Object result = m.invoke(myClass,null); but i get java.lang.IllegalArgumentException: object is not an instance ...

Where is variablilty in stack consumption coming from?

Whilst running test code from this question and fiddling with the JVM's thread stack size, I found that results were not necessarily repeatable: there were values of stack size for which the program would sometimes throw java.lang.StackOverflowError, but sometimes not. My question is: "What is causing the variation in stack space cons...

Why CMS(concurrent mode failure) happened here ?

Operation System: Red Hat Linux 4.8 CPU Info: Intel(R) Xeon(R) CPU 5160 @ 3.00GHz X 16 JDK version: "1.5.0_16" JVM Parameter: -server -Xmx1024m -Xms1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=128m -XX:MaxPermSize=128m -XX:SurvivorRatio=8 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseConcMarkSweepGC -XX:+...

Considerate migration plan for Java5/Java6 applications to Java 7?

I'm currently investigating if it makes sense to delay some minor planned refactoring work and combine it with the migration to Java 7, but I'm a little bit concerned that it might make it harder to trace the causes of some bugs if both code and platform change at the same time. The benefit of the move would be the ability to clean up a...

RtlValidateHeap problem when unloading JVM after JNI_CreateJVM loaded

I have trouble with the jvm.dll when after the returning from the function below I get the error message _HEAP[test_heap.exe]: Invalid Address specified to RtlValidateHeap_ At the moment I dynamically load the JNI_CreateJavaVM method only, everything goes well until I go past the final return statement of the function test_heap below: ...

Side Effects of running the JVM in debug mode

I'd like to realease a Java application in debug mode to allow for easier debugging when random or hard to reproduce problems occur on the customer side. However, I want to get a heads up on potential side effects of doing this? From the Java HotSpot Documentation it seems that there should be no performance penalty. From the link ...

Java : how to check current Perm / PermGen Size?

Hi all: Yesterday when I was running the WebLogic Application Server 11g installer, I encountered a OutOfMemory error, so I Googled for the answer: java -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m -jar wls1032_generic.jar Everything worked :) However, when I think twice about the solution, I might have made a mistake: H...

Running mlutiple threads in CPU

Hi, All we know that JVM schedules the user threads in a single CPU based machine .Why cant a single CP run mltiple process/threads in parallel,What is the constrain stops that capability Also JVM is like a another software which is running in any machine,There may be thousands of other programs may waiting for the CPU cycle at a given...

Memory requirements of an Object reference on a 64 bit JVM

A reference to an Object on a 32 bit JVM (at least on Hotspot) takes up 4 bytes. Does the 64 bit Hotspot JVM need 8 bytes? Or is some clever compression going on? If not, every Object[] would require twice as much heap memory, which I somehow think (hope, expect) is not the case. Update/extra question: Does this really matter, or is th...

What's The Difference Between Java GC Log Lines? ("Total time for which..." vs "[GC")

Java Version: 1.6.0_20 I'm seeing the following in my logs, and I'm trying to figure out the difference beween the first line and the subsequent lines. As far as I know, they are both minor GC related, however there isn't a 1-to-1 between them as there usually is in other GC tutorials I've read. I know how to interpret the first line,...

BEA Workshop keeps terminating with jvm exit code=1

Help!!! I have been tormented with this for months. I keep getting abruptly terminated when debugging or developing on BEA workshop which is an extension of eclipes. Here is the content of my ini file: -vm C:/bea/jrockit_150_11/bin/javaw.exe -vmargs -Xms1024m -Xmx1024m -XX:MaxPermSize=512m -Dweblogic.home=C:/bea/wlserver_10.0 -Dosgi.in...

Does Java guarantee that Object.getClass() == Object.getClass()?

I really do mean identity-equality here. For example, will the following always print true. System.out.println("foo".getClass() == "fum".getClass()); Thanks in advance, ~Mack ...

Java heap size problems with SpringSource tcServer on CloudFoundry

I am using Cloud Foundry with tcServer to deploy my java application but am experiencing out-of-memory issues as I cannot seem to get any java heap settings to take effect. Does anyone have any experience of changing java heap settings using the Cloud Foundry interface? I am using an large EC2 instance (64bit) and I have tried the follo...

Android: com.sun.org.apache.xerces.internal.dom: classNotFoundException

Hi. I am developing an android application at the moment, and i'm facing a problem that i have no idea how to solve. My application communicates with a Tomcat Server, and i'm using ObjectOutputStream to send a Document object to my application from my servlet. There fore, i'm importing org.w3c.dom to my project. The problem i'm facing is...

Running two projects (trunk & branch) at the same time in Eclipse

Hi, I was wondering if it's possible to run two projects at the same time in Eclipse, for example by using two different instances of JVM (if that makes any sense). A bit of the background: I have a project that executes relatively long experiments (6-8h). I have recently managed to come to a point in development where I could branch ...

java decimal separator

Hi mates, Is there a way to configure Java's decimal separators with JVM parameters? I'd know how to do it in code level, but unfortunately this time I cannot touch it. I have now: "1,322.03" and I wish there was some config that would make that look like 1.322,03. Oracle has that NLS_NUMERIC_CHARACTERS, which solve's for me in most c...

Breaking Down Native Memory Usage Within a JVM Process on SLES

I have a WebSphere Portal application running four instances on a single box and after about 7 days of runtime there is only 130-150mb of address space free in native memory (using PMAP). Somewhere in another 7-10 days the figure drops well below 100mb (which we deem dangerous and we start to recycle the JVM). If we don't do the recycl...

Why does my JVM heap size thrash from 2gigs to 8 gigs?

Heap memory size thrashes between 2gigs and ~8gigs about once a minute (see picture). Relevant details: High traffic site Lots of physical memory Redhat 5.5 Java 1.6.0_07 Glassfish 2.2.1 (yes, I know it's old. no, we can't upgrade. yes, i know it's unusual to use as a production app server). -XX:MaxPermSize=192m -XX:+AggressiveHeap -X...

Eclipse memory allocation problem

Hi, I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a -Xmx2g (or -Xmx2048m) I get an error "Failed to create the Java Virtual Machine". 1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the st...

Problem with Runtime.freeMemory() - Java

Hey I'm testing out Runtime.freeMemory() with this code: Runtime runtime = Runtime.getRuntime(); long freeMemory = runtime.freeMemory(); // This is some arbitary factor that should work <= 1 double factor = 0.8; int size = (int) (factor * freeMemory); byte[] testArray = new byte[size]; I'm creating a byte array of size close t...