In my application i run some threads with untrusted code and so i have to prevent a memory overflow. I have a WatchDog wich analyses the time of the current thread (the threads were called in serial).
But how i can determine the memory usage?
I only know the memory usage of the whole VM with Runtime.totalMemory()?
If there is a possibility to find out the usage of the thread, or the usage of the single process it would be great. With the memory usage of the process i could calculate the usage of the thread anyway.
In my application i run some threads with untrusted code and so i have
Share
Since a JVM executing a Java program is a Java process you don’t have to worry about that. All threads share the same memory space in the JVM process.
Hence it is sufficient to rely on