jvm

Clojure: gc overhead limit exceeded, lazy evaluation, pi sequence

For the next code: (ns clojure101.series) (defn avg [[x y]] (/ (+ x y) 2)) (defn avg-damp [seq] (map avg (partition 2 seq))) (defn avg-damp-n [n] (apply comp (repeat n avg-damp))) (defn sums [seq] (reductions + seq)) (defn Gregory-Leibniz-n [n] (/ (Math/pow -1 n) (inc (* 2 n)))) (def Gregory-Leibniz-pi (map #(...

Why defining class as final improves JVM performance?

Quoting from http://sites.google.com/site/gson/gson-design-document: Why are most classes in Gson marked as final? While Gson provides a fairly extensible architecture by providing pluggable serializers and deserializers, Gson classes were not specifically designed to be extensible. Providing non-final classes woul...

Canonical reference on JVM internals for programmer/developers

The title captures my question fairly well. I'm wondering if there is a good resource or leaping-off point for questions about how a JVM (not just HotSpot, but that's obviously the place to start) implements or handles a specific functionality? I'm not looking for the stuff that's in the JLS or JVM Spec -- I know to go there first. ...

marker interface in java

how to create your own marker interface in java.how to notify the JVM to treat as special class? Can any one elaborate it. Thanks in advance.... ...

What are the empty 'pathname' entries of '/proc/smap' for a Java process?

I seem to have a huge memory leak in a large Java application. But the leak does not seem to be within the JVM memory itself (ie: heap, eden, survivor, code, perm_gen, etc.) since I don't run out of this type of memory (ie: it goes up during use, but it goes back down eventually when the GC runs). My problem is that I run out of system...

Lots of ThreadLocalMap entries in memory

Consider a very large Java VM with a great many threads running a web server. Now consider a sample of the output generated by jmap -histo that looks something like this: 4: 5989163 191653216 java.lang.ThreadLocal$ThreadLocalMap$Entry 10: 46786 49012000 [Ljava.lang.ThreadLocal$ThreadLocalMap$Entry; 86: ...

Disable Java JIT for a specific method/class?

I'm having an issue in my Java application where the JIT breaks the code. If I disable the JIT, everything works fine, but runs 10-20x slower. Is there any way to disable the JIT for a specific method or class? Edit: I'm using Ubuntu 10.10, getting the same results both with: OpenJDK Runtime Environment (IcedTea6 1.9) (6b20-1.9-0ubun...

What is the closest you can get to true (resource constrained) isolates in the JVM today?

Posit the following situation: You have a large and complex system (distributed, concurrent, huge dataset) which supports many users. The code is sent to the data. You want to allow mobile code in the system - ie untrusted code that will run within the same JVMs as the rest of the system, to take advantage of the locality of the data,...

Need guidance on alternative JVMs for Apple OS X

Apple has deprecated their JVM and it may not be supported in future versions of OS X. I am not primarily a Java developer, but I do write Java applications now and then, and the primary application I work on uses Tomcat and Opal to provide a SOAP interface to command line executables written in C. I keep seeing suggestions to simply us...

What about Java Physical Machine ?

Java is most important language for mobile devices as it allows the same binary/byte code to be executed on every machine by inserting virtual layer of JVM between byte code and machine. Can we build Java Physical Machine which will take byte code instead of traditional opcode and operand for X86/arm ? so the Actual Operating System Ca...

Sandbox JVM to secure server from untrusted sources

How can protecting my server from malicious activity when accepting and executing uploaded, untrusted code? The users should be able to implement my interface and given data, perform some calculations and return data. No I/O operations are required and certainly no thread/process manipulation or other tomfoolery. Using the java.policy ...

Is there a project that aims to implement (part of) the Android APIs on a desktop JVM?

I am currently pondering the feasability of implementing part of the Android APIs on a desktop JVM and I was wondering whether you had already heard of such a project. If there aren't, and you know good reasons why (beyond "no one has begun that yet"), I would be glad to read them. ...

How to emit and execute Java bytecode at runtime?

I am writing an interpreter in Java for a domain-specific language with some scripting capabilities. I have already implemented a parser and now need to do a back end. To this end I am considering either to write my own interpreter (either working with abstract syntax trees or with some custom bytecodes) or target JVM (emit and execute J...

JNI C++ Debugging Techniques?

I have a Linux C++ application that creates a JVM and makes JNI calls. I am new to JNI, and so far I the only effective way I have found to debug my application during development is by trial and error. What are some techniques to use to debug the infamous "A fatal error has been detected by the Java Runtime Environment" Java VM crashe...

How much memory is allocated for one Integer object in Java? How to find out this value for any custom object?

What is the proper way to measure how much memory from the heap should be used to create new object of a certain type (let's talk about Integers to keep it simple)? Can this value be calculated without experiment? What are the rules in that case? Are these rules strictly specified somewhere or they can vary from jvm to jvm? ...

How to resolve web logic server BEA-000117 and BEA-101162 errors?

I encounter this error: <BEA-000117> <Received a stale replication request for object ...> I went through the documentation and it says that i need to tune garbage collection. How do i actually tune garbage collection? I thought java garbage collection is automatic? Or actually i need to change those JVM memory settings like vmx etc?...

What are the advantages and disadvantages of using Nailgun vs netcat to provide fast CLI to a Java application?

The ways to reduce startup time of Java and Scala applications have been already discussed here and here. One of the solutions suggested there was to use client-server approach with either Nailgun or a simple hand-written server communicating through a TCP socket with netcat. On the one hand, Nailgun is designed for this purpose. On the...

Which real-time (RTSJ) JVM is most preferred?

There seems to be only a handful of JVMs that are implementations of the Real-Time Specification for Java (RTSJ). The Sun/Oracle Java Real-Time System is over $6000 and IBM's real-time WebSphere is over $7000, so many Java developers may never have the opportunity to use either of them. Oracle's JRockit seems to be a free real-time Jav...

Anyway to Boost java JVM Startup Speed?

Hello SO Well , it is said that Java is 10x faster than python in terms of performance, thats what i see from benchmarks too. But what really brings down java is its startup time of JVM which is quite stupid. This is a test i made: $time xlsx2csv.py Types\ of\ ESI\ v2.doc-emb-Package-9 ... <output skipped> real 0m0.085s user 0m...

JVM / ColdFusion "The system cannot find the file specified" LCK errors

I am a Coldfusion wiz, but my JVM error logs are filling up with the following types of errors. Could someone shed some light on these for me and how to fix? Much appreciated. Searched for an hour everywhere and found no good answer or much of any reference. That LCK part has me baffled, as the actual cfm file does indeed exist. 10/...