Search code examples
javaperformancememorylarge-filestemporary-files

temp files in memory in java program


Is there a way to force the temporary files created in a java program in memory? Since I use several large xml file, I would have advantages in this way? Should I use a transparent method that allows me to not upset the existing application.

UPDATE: I'm looking at the source code and I noticed that it uses libraries (I can not change) which requires the path of those files ...

Thanks


Solution

  • The only way I can think of is to create a RAM disk and then point the system property java.io.tmpdir to that RAM disk.