Good, so it's hard. The reason you run into problems is because iOS doesn't have virtual memory while your desktop system is running. The lzmaSDK library is written in such a way that assumes that your system has a lot of virtual memory for decompression. There will be no problems on the desktop. Only when allocating large amounts of memory for unpacking on iOS will you encounter problems. This is best solved by rewriting the lzma SDK so that it is better to use the memory card directly, but this is not a trivial task. Here's how to solve this problem.
Using 7za
There are actually two command line options that you want to pass to the 7zip archive program in order to segment files into smaller pieces. I am going to assume that you are just using the 24 megabyte size that I used, as it was a good space / mem tradeoff. Here is the command line that should do the trick, note that in this example I have large movie files called XYZ.flat, and I want to compress them together in the archive.7z file:
7za a -mx=9 -md=24m -ms=24m Animations_9_24m_NOTSOLID.7z *.flat
If you compare this segmented file with a version that does not split the file into segments, you will see that when segmenting the file becomes a little larger:
$ ls -la Animations_9_24m.7z Animations_9_24m_NOTSOLID.7z -rw-r--r-- 1 mo staff 8743171 Sep 30 03:01 Animations_9_24m.7z -rw-r--r-- 1 mo staff 9515686 Sep 30 03:21 Animations_9_24m_NOTSOLID.7z
So, segmentation reduces compression by about 800K, but it doesn't really hurt, because now decompression routines will not try to allocate a lot of memory. Decompression memory usage is now limited to a 24 megabyte block that iOS can handle.
Double-check the results by printing the header information of the compressed file:
$ 7za l -slt Animations_9_24m_NOTSOLID.7z Path = Animations_9_24m_NOTSOLID.7z Type = 7z Method = LZMA Solid = + Blocks = 7 Physical Size = 9515686 Headers Size = 1714
Pay attention to the “Blocks” element in the above output; it indicates that the data has been segmented into different 24-megabyte blocks.
If you compare the information about the segmented file above with the output without the -ms = 24m argument, you will see:
$ 7za l -slt Animations_9_24m.7z Path = Animations_9_24m.7z Type = 7z Method = LZMA Solid = + Blocks = 1 Physical Size = 8743171 Headers Size = 1683
Pay attention to the value "Blocks", you do not need only one huge block, since it will try to allocate a huge amount of memory when unpacking on iOS.