On Windows: java.io.tmpdir:[C:\DOCUME~1\joshua\LOCALS~1\Temp\]
On Solaris: java.io.tmpdir:[/var/tmp/]
On Linux: java.io.tmpdir: [/tmp]
On Mac OS X: java.io.tmpdir: [/tmp]
The default temporary-file directory is specified by the system property java.io.tmpdir. On UNIX systems the default value of this property is typically "/tmp" or "/var/tmp"; on Microsoft Windows systems it is typically "c:\temp". A different value may be given to this system property when the Java virtual machine is invoked, but programmatic changes to this property are not guaranteed to have any effect upon the the temporary directory used by this method.
To specify the
java.io.tmpdir
System property, you can invoke the JVM as follows:
java -Djava.io.tmpdir=/path/to/tmpdir
By default this value should come from the
TMP
environment variable on Windows systems
操作系统不同 这个系统属性所表示的目录也不同On Windows: java.io.tmpdir:[C:\DOCUME~1\joshua\LOCALS~1\Temp\]On Solaris: java.io.tmpdir:[/var/tmp/]On Linux: java.io.tmpdir: [/tmp]On Mac OS X: java.io.tmpdir:
今天突然收到报警短信,说是/磁盘空间使用超过阀值。经查看,发现是有很多异常的SQL,执行不了,导致一直在处理,产生了临时占用了/tmp磁盘空间。
由于
操作系统
的/tmp空间有限,需要进行参数修改,将
tmpdir
的值路径进行修改。
mysql> show variables like '
tmpdir
';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
|
tmpdir
| /tmp |
+---------------+-------+
1 row in set (0.00 sec
Java
HotSpot™ 64-Bit Server VM warning: Insufficient space for shared memory file:
Try using the -D
java
.
io
.
tmpdir
= opt
io
n to select an alternate temp locat
io
n.
执行 hdfs 命令查看目录时,控制台上有这么一句警告
JVM
报错:共享内存文件空间不足
df -h 以可读性较高的方式来显示磁盘使用信息
可以看到主盘已使用100%
暴力解决办
Java
.
io
.
tmpdir
介绍
System.getproperty(“
java
.
io
.
tmpdir
”)是获取
操作系统
缓存的临时目录,不同
操作系统
的缓存临时目录不一样,
在
Windows
的缓存目录为:C:\Users\登录用户~1\AppData\Local\Temp\
Linux:/tmp
System.getProperty(“”),可以操作一下参数:
Solaris
:
java
.
io
.
tmpdir
:[/var/tmp/]
Linux:
java
.
io
.
tmpdir
: [/tmp] 或 [/var/tmp/]
Mac OS X:
java
.
io
.
tmpdir
: [/tmp]
On
Windows
:
java
.
io
.
tmpdir
:[C:\DOCUME~1\joshua\LOCALS~1\Temp\]
On
Solaris
:
java
.
io
.
tmpdir
:[/var/tmp/]
On Linux:
java
.
io
.
tmpdir
: [/tmp]
On Mac OS X:
java
.
io
.
tmpdir
:
因为未知原因,jdk-8u212-
windows
-x64.exe安装不上,拷贝别人安装好的文件夹C:\Program Files\
Java
\jdk1.8.0_231到自己的电脑,后端程序可以执行,但报以下错误信息:
Unable to create tempDir.
java
.
io
.
tmpdir
is set to C:\Users\ADMINI~1\AppData
解决办法:
删掉拷贝别人...
Unable to create tempDir.
java
.
io
.
tmpdir
is set to C:\Users\SRV-DA~1\AppData\Local\Temp\5\
在
Windows
server,跑了几个月的程序,突然报警了,我也很无语
org.springframework.context.Applicat
io
nContextExcept
io
n: Unable to start web server; nested except
io
n is org.springframework.b
URI uri = new URI("file://" + System.getProperty("
java
.
io
.
tmpdir
") +
"/" + System.getProperty("user.name") + "/");
这将创建一个完全限定的URI,其中包含
操作系统
中当前用户的临时目录。