jvm

Help running a jar from within a java program using JarClassLoader

I'm trying to run a jar within a java program and capture its stdout. I want to do this to avoid the JVM startup cost every time the jar is run. What is the simplest way to do this? I started by modifying Java's JarClassLoader and adding a SecurityManager subclass to that to prevent system exits. The JarClassLoader is a subclass of URL...

What are the best garbage collection settings for client side?

Recent JVM's have a lot of XX parameters for garbage collection (see here for example), but what are the options which can make a client side Swing application really perform better? I should note that one of the things that really annoys me on client side java applications is the large delay in stop-the-world garbage collection. In Int...

Why does Eclipse crash with Xmx, XX:MaxPermSize above certain values?

Running Eclipse 3.5.1, JDK 1.6.0_17 on WinXP SP3 32Bit with 3.5 gigs of RAM. I'm aware of the known Eclipse best practices, still trying to figure out eclipse.ini. This will launch: -Xmx588m and this won't: -Xmx589m. Same with -XX:MaxPermSize. Anything above -XX:MaxPermSize=140m won't launch. The screen of death is simlar to this (tak...

How does Parrot compare to other virtual machines?

Parrot is the virtual machine originally designed for Perl 6. What technical capabilities does the Parrot VM offer that competing virtual machines such as the Java Virtual Machine (JVM)/Hotspot VM and Common Language Runtime (CLR) lack? ...

What do -XX:-PrintGC and XX:-PrintGCDetails flags do?

I found the JVM flags here. Is there a more detailed explaination of what exactly they do? ...

Is it possible a long GC cycle is causing "Connection refused" exceptions?

We're seeing ConnectException with message "Connection refused" sporadically appearing at times when connecting to our Tomcat server. Could these be caused by long GC cycles? (We're activating up the relevant JVM flags to get more log messages on GC cycles, but I thought to ask this here anyways) ...

What is the overhead of a method call in a good Java VM?

Can someone come up with a disassembled machine code assembler listing? I mean there must be some overhead compared to the normal function call in C. The VM needs to track calls to find hotspots and when it uses compiled code it needs to provid ways to change the compiled method on fly if a new loaded class requires a recompilation. I...

What causes JVM exit code 10?

An Eclipse RCP aplication running on Mac OS X 10 is crashing with java exit code 10. What does this mean, and what might be a possible cause? Additional information: eclipse.buildId=unknown java.version=1.5.0_20 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=fi_FI Command-line arguments: -os macosx -ws ...

How to make sure I'm using the "server" JVM?

Sun's JVM comes in two flavors: -client and -server, where the Server VM is supposed to be optimized for long running processes, and is recommended for server applications. When I run java with no parameters, it displays the usage options, which includes the following text: The default VM is server, because you are running o...

Loading a large hprof into jhat.

I have a 6.5GB Hprof file that was dumped by a 64-bit JVM using the -XX:-HeapDumpOnOutOfMemoryError option. I have it sitting on a 16GB 64-bit machine, and am trying to get it into jhat, but it keeps running out of memory. I have tried passing in jvm args for minimum settings, but it rejects any minimum, and seems to run out of memory be...

access running JVM raw memory

Forgive me if this is an ignorant question, I'm not exactly an expert programmer just curious. Is it possible to read the working memory, say for an instance of a class, from inside a running program? I know you can do something like println(theInstance.getClass()); and it will give you the memory address of the instance (I'm assuming ...

In JVM heap can there be more than one object with the same hash code?

This is a an interview question. ...

Can First-class functions in Scala be a concern for allocating a large PermGen Space in JVM?

Regarding first-class functions in Scala, it is written in the book Programming by Scala: A function literal is compiled into a class that when instantiated at run-time is a function value. When there will be many first-class functions used in a program, will this affect the JVM's PermGen space? because instead of simple functi...

JVM system time and time inconsistency OS system

Using websphere application server 6.0.1.23 on aix 5.3 In applications (Lotus connections), working on an application server (WAS). Entries that make application users are recorded with the wrong date, not one that grants the date command. Has anyone encountered a similar situation? ...

Why is JVM creating a copy of an object when passing it to a method?

I encountered a strange problem today: i had a method that took two Date objects as arguments. The calling method passed reference to the very same object as both of them (the method in question was EqualsBuilder.append). The first parameter got passed fine, but the second one not. It was a new Date object that was different from the fir...

Memory effects of synchronization in Java

JSR-133 FAQ says: But there is more to synchronization than mutual exclusion. Synchronization ensures that memory writes by a thread before or during a synchronized block are made visible in a predictable manner to other threads which synchronize on the same monitor. After we exit a synchronized block, we release the ...

Java/JVM for C++ programmer?

What books can you recommend for learning Java for a C++ programmer? Also what do you recommend to read for learning JVM features for using JVM-based languages effectively? ...

How to strip down JVM to get the smallest install possible?

I have a Java app to deploy and want to deploy the JVM along with it (to simplify install). I want to have the JVM stripped down to only include the pieces the app needs to keep the distributable small. How can I strip down the JVM to bring the size down? Can this be done with the Java Kernel or is there some alternative to the Sun JVM t...

Infering number of bytecodes interpreted by Java runtime?

I'm trying to infer the number of bytecodes that the JVM "interprets"; In quotes because surely they are also compiled. Is there any way or JVMTI/JVMPI interface or instrumentation which can provide some sort of inferred metric on this? ...

Java server jvm installation on windows 32 bit systems

I am trying to bundle java as a part of a java product that should be installed silently with a single click and are having some issues: My installation has the following requirements: Has no be silent and require no user input or action excpect a doubleclick on the installation file (no configuration and post install steps) Has to setu...