kyriosli / node-shared-cache

An interprocess shared LRU cache module for Node.JS
149 stars 30 forks source link

Linux系统中,内存占用无法释放的问题 #6

Closed Gaubee closed 6 years ago

Gaubee commented 7 years ago

执行了release。/dev/shm下面的文件确实也减少了,文件夹大小也减少了。 但是在执行df -h的时候,发现/run/shm的占用一直在增加,直到进程关闭了,才能释放。

mgttt commented 7 years ago

you should definitely write standalone script to delete it manually. the share-mem opener have no responsibility to maintain the hook, 'coz it could be killed (for e.g. by root or some admin) at anytime.

kyriosli commented 6 years ago

是的,就像linux磁盘的inode引用计数一样,共享内存空间直到最后一个引用被删除后(包括/dev/shm,通常需要重启或手动releaserm)才会被释放。