Finding Memory Usage in Java

后端 未结 8 2311
野趣味
野趣味 2021-02-09 13:52

Following is the scenario i need to solve. I have struck with two solutions.

I need to maintain a cache of data fetched from database to be shown on a Swing GUI. Wheneve

8条回答
  •  我在风中等你
    2021-02-09 14:00

    It is entirely normal for a JVM to go up to 100% memory usage and them back to say 10% after a GC and do this every few second.

    You shouldn't need to try managing the memory in this way. You cannot say how much memory is being retained until a full GC has been run.

    I suggest you work out what you are really trying to achieve and look at the problem another way.

提交回复
热议问题