Hi Experts! Here is the problem I have encountered:
My application is written in java and uses JDK 6 to compile a series of strings dynamically using JAVAX.TOOLS.
This process is done every seconds, therefore the class names are as follows:
Where the long number is the millisecond epoch. (The reason the file name & class name changes are because the dynamic code is downloaded from a server and is different every time, otherwise the code will just look for the first compiled code).
Now this makes the application to create thousands of CLASSes in the classes directory and the size of that directory is increased over 400 MBs per 12 hours.
I have tried using regular java FILE.delete method, but since the class is locked from the custom classloader I have, it fails every time.
Also, Its not possible for me to unload the class and then remove, or at least I dont know how.
Your help is highly appreciated.