staticrypt icon indicating copy to clipboard operation
staticrypt copied to clipboard

Out of memory exception

Open b3hdad opened this issue 6 years ago • 1 comments

Hi,

I tried cryptojs with a bit larger files (~140 Meg) and it results in uncaught exception: out of memory. I even modified the code to open the file, read the content and pass it to the encryptor.

Any chance on fixing this?

Thanks. Behdad.

b3hdad avatar Jun 28 '19 00:06 b3hdad

Naive solution can be to increase memory limit with node --max-old-space-size=4096 (of something else, see here), there might be a way to encrypt buffers with crypto-js and only load a portion of the file but it needs to be investigated.

I don't know if/when I'll have time to do it, if someone stumbles upon this issue and wants to take a stab at it you're welcome to do so.

robinmoisson avatar Feb 10 '22 09:02 robinmoisson

Thank you for reporting the issue - this would take a bit of work and I don't see it as the typical use case or myself working on that in the foreseeable future, so I'm closing for now. The current recommended solution is to increase the memory limit or not encrypt very large files with staticrypt.

If more people have a use case for large HTML files please feel free to comment here as well (or open a PR) and I might re-open.

robinmoisson avatar Nov 21 '22 17:11 robinmoisson