-
Couldn't load subscription status.
- Fork 27
Description
It seems like the SourceQueryClient has a memory leak. Running the reproducer for an extended period of time (multiple hours) with a profiler shows that the heap memory increases over time. This image was taken after roughly one hour:

It'll very, very slowly go up until the JVM crashes.
I think it might be the Platform#TASK_QUEUE_LIST that causes those issues. It's size is growing over time and from the code it seems like old entries are not removed from that list when the SourceQueryClient is closed.


Reproducer: https://github.com/DarkAtra/async-game-lib-memory-leak
Specs:
MacOS 13.3.1 (22E261)
openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08, mixed mode, sharing)
Note: creating that many instances of the SourceQueryClient might not be desired but i think it shouldn't leak nonetheless.