I'm using a third library in Java which a uses a singleton pattern. After using this library for a short time I no longer need this library and ready to free it, but because it uses a singleton pattern and doesn't supply any clean/free/close method which cleanup the allocated memory will keep in the heap as long as my application is running.
My question is: can I clean memory that was allocated for this library even if it doesn't supply any function for this?