I have a slotted java system that runs a code every 2 seconds which takes less than 100ms every time it runs. I want to avoid running garbage collection during that 100ms run but run it in the remaining 1.9s where the system is free. Currently garbage collection may run during that 100ms and adds about 100ms more to it which is unacceptable in my case.
The memory usage of program is about 2G and it may create many small objects during that 100ms. I also run it on a multi-core system (4 cores and more).