jvm

Experiences with escape analysis enabled on the JVM

I've just tried the -XX:+DoEscapeAnalysis option enabled on a jdk6-u18 VM (on solaris) and had a rather disappointing experience. I'm running a scala application which has rather a lot of actors (20,000 of them). This is a recipe for garbage-creation! Typically the app can run with 256Mb of heap but generates huge amounts of garbage. In...

Strange GC behaviour of Scala actors application

I have an application which uses rather a lot of actors: 25,000 to be precise. It uses Scala 2.7.7 and is running on jdk6_u18. It basically listens to and processes market data and has very little state. It starts at 8.02am every day and within the hour it has crashed with an OutOfMemoryError. "Aha" you say, "you have a memory leak!" Ex...

How JVM access the file system

Hi there, I have an argument with my boss who is convinced that the JVM uses JNI to access native things like the file system. I think he is wrong because the JVM itself is a native code and it communicates directly with the OS - it doesn't need the JNI boilerplate to access the file system. Please help me to clarify how the JVM works ...

java program terminates unexpectedly without giving any error message !

I have written a java program which needs to process thousands of text files (all needs to be loaded on memory). It works fine with as many as 123 input files, but when I run it to process around 5000 files, it terminates unexpectedly in the middle of the road, without giving any error message/exception. Can anyone give me clue about wha...

Equivalent of the DLR for the JVM?

Is there an equivalent of the DLR (Dynamic Language Runtime for .NET) on the JVM? I'm aware that I could go about and implement my own dynamic bindings and emitting my own bytecode with Java. But is there any pre-built framework (like the DLR) so I don't have to re-invent the wheel? ...

Efficient Number of Threads

I want to optimize my application number of threads. Almost all of them have IO beside CPU usage in an equal value. How much is the efficient number of threads when there are no other applications running in system. I want the answer for Windows and under JVM. ...

What are bytecodes and how does the JVM handle them

Hi, I heard many times that Java implemments JIT(just-in-time) compilation, and its bytecodes which are portable across platforms get "interpreted" by JVM. However, I don't really know what the bytecodes are, and what the JVM actually mean in Java language architecture; I would like to know more about them. ...

Is Excelsior jet compiled apache tomcat server redistributable as part of an opensource project?

I stumbled upon excelsior jet http://www.excelsior-usa.com/protect-java-web-applications.html where in they have a compiled version of apache-tomcat which don't rely on jvm anymore. I know for sure apache-tomcat is open source and could be reditributed as part of your compatible opensource project. Now, I want to know if this compiled ve...

How to improve jRuby load time?

I have to wait quite long time (comparing to my friends machines) for executing scripts on jRuby, especially when I'm running rake tasks or tests. I've tried jRuby version 1.3.1 and 1.4.1 with and without ruby-debug gem and the same problem occurred in each configuration. The question is simple: Is there any way to improve jRuby load p...

Is there any way to pre-allocate the heap in the .NET runtime, like -Xmx/-Xms in Java?

On most platforms and with most JVMs you can pre-allocate the heap on start-up by setting the -Xmx and -Xms options (or a variant thereof) to the same size. Is it possible to do the same with .NET, and if so, how? ...

Is it possible to log if a class in the JVM is used?

I have a Tomcat with some applications running. I cannot restart the Tomcat but I would like to monitor the usage of class files. I would like to log if a specified class is used. Is this possible? How could I accomplish it? Class Usage: If an object for this class is instantiated or methods are called etc. Clarification: I cannot res...

Warming up high throughput Java apps

I recently learned about scenarios which require warming up an app (with high throughput requirement) before they start serving real requests. The logic behind this was to allow JIT to do its performance magic! Is this a norm for Java apps or is this generally done for memory heavy (footprint) apps? ...

JVM crashes under stress on RHEL 5.2

Hello I've got (the currently latest) jdk 1.6.0.18 crashing while running a web application on (the currently latest) tomcat 6.0.24 unexpectedly after 4 to 24 hours 4 hours to 8 days of stress testing (30 threads hitting the app at 6 mil. pageviews/day). This is on RHEL 5.2 (Tikanga). The crash report is at http://pastebin.com/f639a6cf...

Does a JVM exit when a stackoverflow exception occurs in one of the executing threads?

Does a JVM exit when a stack overflow exception occurs in one of the executing threads? ...

Running a bash script from the JVM

I'm having trouble running a simple bash script from Java. Specifically: ... try{ ProcessBuilder pb = new ProcessBuilder("/bin/bash", "-c", command); pb.directory(new File(dir)); Process shell = pb.start(); int exitVal = shell.waitFor(); ... where 'command' the absolute path to a bash script that is executable by all and 'dir' is th...

creating a JVM from within a JNI method

Is it possible to create a JVM from within a JNI method using the JNI API? I've tried to do this using the JNI function "JNI_CreateJavaVM()", but it's not working (the function keeps returning a value less than zero). Here is the basic code I'm using (C++): JNIEnv *env; JavaVM *jvm; jint res; #ifdef JNI_VERSION_1_2 JavaVMInitArgs vm_...

Security of scala runtime

I'm developer of Robocode engine. We would like to make Robocode multilingual and Scala seems to be good match. We have Scala plugin prototype here. The problem: Because users are creative programmers, they may try to win battle different ways. As well robots are downloaded from online database where anyone could upload one. So gap in s...

Java: Would decreasing the stack size speed up frequent method invocations?

Hello, everyone! Everywhere I keep reading about increasing the JVM stack size (i.e. to allow deeper recursions). But I'm asking myself, would decreasing of the stack size speed up method invocation? Probably my understanding is wrong, but I assume, that the allocation speed of each stack (not only for recursive method calls) depends ...

What are some fundamental Feature/Architectural difference between the BEAM and JVM?

What are some fundamental Feature/Architectural difference between the BEAM and JVM? Yes I know: one was originally built around java and the other built around erlang I understand the JVM (somewhat) and want to compare their structures For example I know that the JVM has one Global GC and BEAM has one per process ...

How can a JVM be written in Java

I was briefly reading about Maxine which is an open source JVM implementation that written in Java. This sounds circular to me. If java requires a virtual machine to run in, how can the virtual machine itself be written in Java (won't the VM code require a VM in which to run, and so on?). Edit: Ok, so I see I overlooked the fact that ...