3
確定這裏不是空的Linux的緩存是我的代碼:可以通過java的
String[] commands = {"sync && echo 3 > /proc/sys/vm/drop_caches"};
Process pr = Runtime.getRuntime().exec(commands);
pr.waitFor();
我也得到:
Exception in thread "main" java.io.IOException: Cannot run program "sync && echo 3 > /proc/sys/vm/drop_caches": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at java.lang.Runtime.exec(Runtime.java:615)
at java.lang.Runtime.exec(Runtime.java:483)
at MyTest.main(MyTest.java:896)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
我複製粘貼在命令行相同的字符串,我認爲作品的罰款。
什麼問題?我正在使用Ubuntu 11.10。謝謝
感謝這就是它! – Alex 2012-07-21 11:56:11