EC2-内存Cache的清除

本文介绍了解决程序中内存泄露的方法,特别是在无法切换到Root用户的情况下如何清除缓存内容。通过使用sudo权限执行特定命令,可以有效地释放内存资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于程序的原因,内存出现泄露,测试中需要清除缓存内容,
但是Root用户切换不过去,因此搜了一些其他方法

echo 3 | sudo tee /proc/sys/vm/drop_caches

确认

cat /proc/meminfo
or
free -m
RuntimeError: Error building extension 'filtered_lrelu_plugin': [1/4] D:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\bin\nvcc --generate-dependencies-with-compile --dependency-output filtered_lrelu_wr.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=filtered_lrelu_plugin -DTORCH_API_INCLUDE_EXTENSION_H -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\TH -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\THC "-ID:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\include" -ID:\anaconda\envs\pytorch2.3.1\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use_fast_math --allow-unsupported-compiler -c C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py39_cu118\filtered_lrelu_plugin\2e9606d7cf844ec44b9f500eaacd35c0-nvidia-geforce-rtx-4060-ti\filtered_lrelu_wr.cu -o filtered_lrelu_wr.cuda.o FAILED: filtered_lrelu_wr.cuda.o D:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\bin\nvcc --generate-dependencies-with-compile --dependency-output filtered_lrelu_wr.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=filtered_lrelu_plugin -DTORCH_API_INCLUDE_EXTENSION_H -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\TH -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\THC "-ID:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\include" -ID:\anaconda\envs\pytorch2.3.1\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use_fast_math --allow-unsupported-compiler -c C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py39_cu118\filtered_lrelu_plugin\2e9606d7cf844ec44b9f500eaacd35c0-nvidia-geforce-rtx-4060-ti\filtered_lrelu_wr.cu -o filtered_lrelu_wr.cuda.o [2/4] D:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\bin\nvcc --generate-dependencies-with-compile --dependency-output filtered_lrelu_rd.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=filtered_lrelu_plugin -DTORCH_API_INCLUDE_EXTENSION_H -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\TH -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\THC "-ID:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\include" -ID:\anaconda\envs\pytorch2.3.1\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use_fast_math --allow-unsupported-compiler -c C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py39_cu118\filtered_lrelu_plugin\2e9606d7cf844ec44b9f500eaacd35c0-nvidia-geforce-rtx-4060-ti\filtered_lrelu_rd.cu -o filtered_lrelu_rd.cuda.o FAILED: filtered_lrelu_rd.cuda.o D:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\bin\nvcc --generate-dependencies-with-compile --dependency-output filtered_lrelu_rd.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=filtered_lrelu_plugin -DTORCH_API_INCLUDE_EXTENSION_H -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\TH -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\THC "-ID:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\include" -ID:\anaconda\envs\pytorch2.3.1\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use_fast_math --allow-unsupported-compiler -c C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py39_cu118\filtered_lrelu_plugin\2e9606d7cf844ec44b9f500eaacd35c0-nvidia-geforce-rtx-4060-ti\filtered_lrelu_rd.cu -o filtered_lrelu_rd.cuda.o [3/4] D:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\bin\nvcc --generate-dependencies-with-compile --dependency-output filtered_lrelu_ns.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=filtered_lrelu_plugin -DTORCH_API_INCLUDE_EXTENSION_H -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\TH -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\THC "-ID:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\include" -ID:\anaconda\envs\pytorch2.3.1\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use_fast_math --allow-unsupported-compiler -c C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py39_cu118\filtered_lrelu_plugin\2e9606d7cf844ec44b9f500eaacd35c0-nvidia-geforce-rtx-4060-ti\filtered_lrelu_ns.cu -o filtered_lrelu_ns.cuda.o FAILED: filtered_lrelu_ns.cuda.o D:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\bin\nvcc --generate-dependencies-with-compile --dependency-output filtered_lrelu_ns.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=filtered_lrelu_plugin -DTORCH_API_INCLUDE_EXTENSION_H -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\TH -ID:\anaconda\envs\pytorch2.3.1\lib\site-packages\torch\include\THC "-ID:\CUDA\CUDA11.3\NVIDIA GPU Computing Toolkit\include" -ID:\anaconda\envs\pytorch2.3.1\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 --use_fast_math --allow-unsupported-compiler -c C:\Users\Administrator\AppData\Local\torch_extensions\torch_extensions\Cache\py39_cu118\filtered_lrelu_plugin\2e9606d7cf844ec44b9f500eaacd35c0-nvidia-geforce-rtx-4060-ti\filtered_lrelu_ns.cu -o filtered_lrelu_ns.cuda.o ninja: build stopped: subcommand failed. Failed!怎么解决
最新发布
06-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值