-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-persist reading all files to RAM ? #148
Comments
if you use any of these 4 functions, https://github.com/simonlast/node-persist/blob/master/src/local-storage.js#L133-L166 yes, it seems that is in fact reading everything to ram, temporarily, this should be garbage collected since we don't maintain a ref to |
Also, I dont recommend using this library for handling large or high concurrent transactions, maybe something like redis is better for your case. node-persist is designed as a light weight temporary localStorage, with a small limit, inlined with what the browsers currently offer for localStorage, which is 5mb |
I am using it to cache some files in my Node.js app (subtitle files). I need to cache these files for 7 days. However, it seems that node-persist is not suitable for my needs. Every time it clean up expired files, node-persist loads all of them into RAM. (The total amount of RAM needed remains unchanged compared to caching directly into RAM, even though it's only temporary) I've switched to using SQLite for temporary storage, and everything is working fine now. |
you are right!, cleaning up expired does in fact load everything, that's a bug that i will fix. |
My Node.js application reports insufficient memory. The timing seems to coincide with the TTL (Time to Live) of node-persist, and when I inspect the source code, I observe that node-persist appears to be reading all files into the RAM...
The text was updated successfully, but these errors were encountered: