jvm

Are there compelling reasons not to use Groovy?

I'm developing a LoB application in Java after a long absence from the platform (having spent the last 8 years or so entrenched in Fortran, C, a smidgin of C++ and latterly .Net). Java, the language, is not much changed from how I remember it. I like it's strengths and I can work around its weaknesses - the platform has grown and decidi...

Is there a maximum number you can set Xmx to when trying to increase jvm memory?

Is there a max. size you can set Xmx to? I set it to 1024m and eclipse opens ok. When I set it above 1024, eclipse doesn't open and I get the error "jvm terminated. Exit code=-1"... I was doing this because I keep getting an "java.lang.OutOfMemoryError: Java heap space". I am reading in a 35.5Mb .txt file and this error occurs when it's...

Where is the current version of the Java Virtual Machine Specification?

It would appear as though the only way to get the current version of the Java Virtual Machine Specification is to take the Second Edition, merge in the Existing Changes and then add on top of that the Java6 proposed changes which are not really proposed anymore, but actual. Really? Two question arise out of this: Is that all the delt...

How to the JVM to use a given jaas.conf file?

How to I setup the JVM to use a given jaas.conf I created as JAAS setup? Maybe there is a JAAS picks up a configuration property which I can set on startup with -D? ...

FileNotFoundException thrown when the file does exists.

Hello. I'm facing this strange problem. I'm trying to read a file that is located in another machine as a shared resource: \\remote-machine\dir\MyFileHere.txt When I run a standalone application ( a 16 lines java file ) everything is just fine. But when I attempt to read the same file with using the same class and the same method fr...

Why doesn't Sun do a C# to Java byte code compiler?

We Want to Run Our C# Code on the JVM My company has a large C# code base. Well over half of this code is our core engine for creating, reading, modifying, calculating and writing Excel workbooks. We frequently get questions from customers and potential customers asking whether we are going to build a Java version of our engine - many o...

JVM for WEPOS

I'm looking into running a j2se(1.5) application on the WEPOS(Windows Embedded for Point of Service) platform. I noticed that Sun offeres a java runtime for Windows XP embedded (Java SE for Embedded 5.0). I'm wondering if Can I use the standard Sun Hotspot on the WEPOS platforms? Will Java SE for Embedded 5.0 also run on WEPOS? (If ...

How do I write a correct micro-benchmark in Java?

As the title says. How do you write (and run) a correct micro-benchmark in Java? I'm looking here for code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/iteration or iterations/time, and why? Near Duplicate of: http://stackoverflow.com/questions/410437/is-stopwatch-benchmar...

Factory methods for implementations of Java interfaces wrapped with Scala implicits?

I'm using Scala implicits to define a rich wrapper for a Java interface: class RichThing { def richStuff: Unit = {} } In the companion object I define the implicit conversion and an apply factory method: object RichThing { implicit def rich( thing: JavaThing ) = new RichThing() def apply() = new RichThing() } With this, I...

Modify JVM args from inside the JVM

Is there a way to modify the jvm args from inside of the jvm? Specifically, I want to be able to change the maximum heap size of the jvm from inside of it. Is this possible? Edit: I guess I should add the reason I wanted to do this. I have a few Java programs that are run on different machines/platforms. These programs have configur...

jvm design decision

Why does the jvm require around 10 MB of memory for a simple hello world but the clr doesn't. What is the trade-off here, i.e. what does the jvm gain by doing this? Let me clarify a bit because I'm not conveying the question that is in my head. There is clearly an architectural difference between the jvm and clr runtimes. The jvm has a ...

Is it possible to pass the X Display name to the JVM

Is it possible to specify which X display the JVM is to launch it's windows on through the JVM? I am thinking something like this java -DISPLAY=THE_DISPLAY_I_WANT:0.1 -jar my.jar I looked at the man pages and I can't find anything. or do I need to wrap my call to the jvm in a shell script like this #/bin/sh export DISPLAY=THE_DISPL...

Is JDK 6u14 Garbage First (G1) garbage collector, suitable for JRun?

Garbage First (G1) garbage collector http://weblogs.java.net/blog/opinali/archive/2009/02/here_comes_jdk.html Do you think this garbage collector is better for JRun, running ColdFusion 8? ...

How to reset or kill JVM context?

I am running a simple java client through java <class file> command. The java command is actually invoked by a system process. This is on Unix. We were facing problem with X11 Display. So we added export DISPLAY=:0.0 in the startup file and the Display problem was resolved. Now when the export DISPLAY=:0.0 line is removed from the start...

Is there a worst case implementation of the JVM?

The Java memory model makes it clear what can and cannot be assumed about how threads interact through memory. For example, if one thread writes a new value to a field without appropriate synchronization then the new value is not guaranteed to be observable by other threads. In practice, however, other threads might anyhow read the new v...

Find out what JVM Eclipse is running on

I'm currently trying to tune my Eclipse installation and bumped into the "-vm" option. Other posts on SO mentioned that it's good to always use the latest JVM available because they keep getting better in terms of performance, so I'm likely to do that. I was wondering though how you could find out what JVM Eclipse runs on if you are not ...

JVM performance tuning for large applications

The default JVM parameters are not optimal for running large applications. Any insights from people who have tuned it on a real application would be helpful. We are running the application on a 32-bit windows machine, where the client JVM is used by default. We have added -server and changed the NewRatio to 1:3 (A larger young generation...

How to show source line numbers in jstack output ?

This is a jstack output from a running JVM "FooThread" prio=10 tid=0x00007f159c2ca000 nid=0x6e21 waiting on condition ..snipped java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at com.myco.impl.QueueFooThread.run(Unknown Source) I want the line number in QueueFooThread to show up l...

Can you mix the JVM languages? ie: Groovy & Clojure

I understand that you can easily mix groovy&java, clojure&java, whateverJvmLang&java. Does this also mean I can have clojure and groovy code interact as well? If I use Grails or jRoR, can I also make use of clojure in that environment? ...

Can the JVM provide snapshot persistence?

Is it possible to dump an image of a running JVM and later restore the previous state by loading the image into the JVM? I'm fairly certain the answer is negative, but would love to be wrong. With all the dynamic languages available for the JVM comes an increase in interactivity, being able to save a coding session would help save time...