When I create a file in the /tmp/hsperfdata_/ directory and then run the jps command, the file I just created gets deleted. At what point does the JVM delete the file I created?
I debugged the source code of the jps command and did not find any logic for deleting files. The file has already been deleted at the entry point of the main method of the jps command.
when creating the vm(
Threads::create_vm), global data structure initialization (PerfMemory::perfMemory_init) takes place. During this process, thecleanup_sharedmem_resourcesmethod is invoked to clean up outdated files in/tmp/hsperfdata_<user>/.