Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can the RTGC work on memory in the regular heap with java.lang.Threads? In other words, with a third-party application binary (with no source code), can I still benefit from Java RTS?

0
Posted

Can the RTGC work on memory in the regular heap with java.lang.Threads? In other words, with a third-party application binary (with no source code), can I still benefit from Java RTS?

0

The java.lang.Threads are not deterministic. They can only run in the Time-Sharing priority class. This means a thread that takes too many computation cycles will relinquish the CPU to let other threads run. The only advantage of the RTGC is that, on a multi-processor machine, it could run at the same time as your application thread, on another CPU. If you run the GC at a higher priority than the java.lang.Thread, you can ensure that it will recycle memory on time and that the threads will not be blocked because of the GC (for example, they will at worst just see one less CPU, the one used by the RTGC). In short, on a multiprocessor system, the RTGC can solve the jitter due to the GC even for java.lang.Threads, but it does not solve all the other sources of non-determinism (for example, TimeSharing priorities, JIT compilation).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.