JVM code cache exceeds ReservedCodeCacheSize

I have a java app running in a docker with flags on OpenJDK8: -XX:+UseContainerSupport -XX:MaxRAMPercentage=80.0 -XX:NativeMemoryTracking=summary and I’ve noticed that Code Cache memory allocation …

Implementation of invokevirtual in JVM

I had expected that the Java Virtual Machine would use a simple lookup table for normal method invocations: The object contains a pointer to a lookup table with the addresses for all methods that the …

Setting/changing default Java MaxHeapSize or changing default JVM command settings

I’m using a python script that calls the jvm. Unfortunately, the script doesn’t allow me to pass arguments to the jvm command, so I can’t bump up the max heap size via the Xmx flags. Is there a way to …

Memory Leak Example -references and objects [closed]

I have the below method.Suppose i call A.m1() 10,000 times from class B. So all 10,000 MyObj objects will be garbage collected as their scope is only within the m1() method. There is no memory leak? …

How Kotlin coroutines will use Project Loom? [closed]

Right now, Kotlin coroutines are implemented without help of JVM. It does not use something like green (virtual) threads. You can read about implementation of coroutines here – https://github.com/…

Java memory leak with a data source

I have heard many times that not closing database connections might lead to a memory leak. (For example in this article) I tried reproducing the same issue by getting a connection from org.apache….

Why Kotlin/Java doesn’t have an option for preemptive scheduler?

Heavy CPU bound task could block the thread and delay other tasks waiting execution. That’s because JVM can’t interrupt running thread and require help from programmer and manual interruption. So …

How to dynamically cast an object (of class Object) to the method return type using ASM?

What I want to do is to modify a method using ASM: I push an object (of class Object) to the stack I want to cast that object to the return type of that method Return that casted object. My code in …

Will an application made in JDK 14 run on a machine that has Java version 8 installed?

My question stems from this… when you google “download java” the first result is this: https://www.java.com/en/download/ This prompts you to install java 8. If I’m creating an application using JDK …

Can JVM bytecode running on the GraalVM be instrumented by a custom `TruffleInstrument`?

I would like to write a Truffle instrument which can instrument Java programs (or at least JVM bytecode programs) when they are run on GraalVM. I have been investigating different ways to perform …