如何处理/tmp/jar_cache#######.tmp? [英] how can i handle with /tmp/jar_cache#######.tmp?

查看:156
本文介绍了如何处理/tmp/jar_cache#######.tmp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Springboot 2.1.4与EmbeddedTomcat一起使用.当我运行服务器时,将创建/tmp/jar_cache###.tmp.我该如何使用jar_cache ###.tmp?

I am using springboot 2.1.4 with EmbeddedTomcat. When i run my server, /tmp/jar_cache###.tmp is created. How can i handle with jar_cache###.tmp?

我正在使用CENTOS 7和Java版本"1.8.0_162".

I am using CENTOS 7 and java version "1.8.0_162".

  1. 如果我将tmpdir更改为其他目录,而不是/tmp,那么如何处理默认创建的大量jar_cache ###?

  1. If i change tmpdir to other directory, not /tmp, then how can i handle with a lot of jar_cache### that is created by default?

使用/tmp目录,如果清除了我的应用程序中正在使用的jar_cache,该怎么办?

Using /tmp directory, What if jar_cache was cleared that was using in my application?

java    46030  www  DEL       REG              253,2                2830 /tmp/jar_cache7122103988160656171.tmp
java    46030  www  DEL       REG              253,2                2842 /tmp/jar_cache8134973409906757503.tmp

java    46030  www   25r      REG              253,2    414240      2830 /tmp/jar_cache7122103988160656171.tmp (deleted)
java    46030  www   27r      REG              253,2    800016      2842 /tmp/jar_cache8134973409906757503.tmp (deleted)

推荐答案

SpringBoot的某些版本中显然存在一个错误,该错误会导致 jar_cache 文件(处于DEL状态)累积:

There is apparently a bug in some versions of SpringBoot that leads to jar_cache files (in DEL state) accumulating:

  • https://github.com/spring-projects/spring-boot/issues/9866 dup of #9240
  • https://github.com/spring-projects/spring-boot/issues/9240 resolved

根据问题跟踪链接,此问题已在SpringBoot 2.0.0中修复.

According to the issue tracker links, this was fixed in SpringBoot 2.0.0.

现在我从您的问题中看到您正在使用2.1.4,因此可能不是导致您出现问题的上述特定问题.但是,第一个链接中可能有一些线索可能会帮助您弄清是什么原因引起的.

Now I see from your question that you are using 2.1.4, so it probably isn't the specific issue above that is causing your problem. However, there are likely to be clues in the first link that may help you to work out what your problem is caused by.

要回答您的问题:

  1. 是的,这些是默认创建的,但是在应用程序重新启动时应清除它们.
  2. 我希望更改 TMPDIR 会影响文件的创建位置.试试看吧!
  3. 如果应用程序仍打开文件,则从目录中删除文件将不会释放任何文件空间.
  1. Yes these are created by default, but they should be cleaned up when you application restarts.
  2. I expect changing TMPDIR will affect where the files are created. Try it and see!
  3. Deleting the files from the directory won't free any file space if the application still has the files open.

也有可能通过调用 System.gc()使文件消失.是的,出于性能原因,调用 System.gc()通常是一个坏主意.但是,如果缓存文件确实是一个问题,那么这可以解决.

It might also be possible to get the files to go away by calling System.gc(). Yes, it is generally a bad idea to call System.gc() for performance reasons. But this could be a workaround if the cache files are really a problem.

这篇关于如何处理/tmp/jar_cache#######.tmp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆