I think this memory is caused by the generation of objects used by swing, like various user interface events (mouse movement, etc.). Swing tends to generate objects for each event and invokes listeners that handle these events. After that, these event-related objects are no longer used (unless you are referencing them).
This is not a memory leak, this is normal behavior. In fact, in your screenshot of the memory consumption screen, memory drops sharply when the garbage collector releases these objects.
source share