Hello, I have some questions about LZMA.
I found this comment below at LzmaLib.h.
RAM requirements for LZMA:
for compression: (dictSize * 11.5 + 6 MB) + state_size
for decompression: dictSize + state_size
state_size = (4 + (1.5 << (lc + lp))) KB by default (lc=3, lp=0), state_size = 16 KB.
LZMA properties (5 bytes) format
Offset Size Description
0 1 lc, lp and pb in encoded form.
1 4 dictSize (little endian)./
I am curious about how each compression/decompression memory usage formula comes.
(especially a very big constant 6 MB for compression...)
And is it possible to use very small memory(about 4KB) for compression/decompression?
Thanks in advance.
Most of additional 6 MB is used by multithreading (2-threads LZMA) code.
LZMA can't work with 4 KB RAM.
LZMA decoder probably can work with 8 KB of RAM in some mode.
Current LZMA encoder code probably needs at least 1 MB of RAM.
When you say: "LZMA decoder probably can work with 8KB of RAM in some mode". Which mode do you refer? How could be this mode configured?
Is it possible to disable the "Probs" buffers, in order to reduce RAM although I assume it will decrease speed?
You can use lc=0 (lc0) switch (when you create lzma file) to reduce state size.
Thank you very much.
So, is using multithreading optional? I want to disable multithreading to reduce memory usage.
If not, in order to disable multithreading, does it need lots of effort to revise code?
Yes, you can disable multithreading in options of LZMA encoder.
Please you said that Current LZMA encoder code probably needs at least 1 MB of RAM. Can you explain this more, how to reduce to use a minimum RAM for encoding it's not a problem if the encoding rakes more time
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.