EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Compression Not Working

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
Posted: 03/25/2014 12:12:16
by Simon King (Basic support level)
Joined: 03/24/2014
Posts: 17

I am unable to get compression to work, with the following code added on top of the basic SimpleMounter example:

if frmWizard.rbtVariableSize.Checked then
NewStorage.SetFileCompression('\', crZLib, 9, 16, '');
NewStorage.FormatFixedSize(Int64(frmWizard.spnStorageSize.Position) * 1024 * 1024, 0);
NewStorage.SetFileCompression('\', crZLib, 9, 16, '');


Storage.SetFileCompression('\', crZLib, 9, 16, '');

When I copy a compressible file (a Server 2003 VM) to the file system, it is not compressed, because the file system file is still the exact size of the uncompressed VM itself.

Any thoughts on how to address this issue? Is there a way to get compression working by default for all folders/files in the SolFS file system - I have tried various approaches already, without much luck...

PS: I chose 16 as the number of pages to be compressed together, since my page size is 4K, and this results in a block size of 64K - the exact block size NTFS uses, I believe; so I thought it would be a good setting.
Posted: 03/26/2014 03:13:57
by Alexander Plas (EldoS Corp.)


I've rechecked the compression and it works as designed. The problem with storage size is caused by two things. On file copying the OS first sets the file size and SolFS must allocate space for whole uncompressed file. During the copying SolFS compresses file's data and some allocated space in the storage left unused. If you then copy another files this space will be used. The storage file should be compacted, but the OS may prevent compact operation if there are some files or directories opened. It is better to manually call Compact method in order to compact unused space in the storage.

The compression scheme in SolFS is quite similar to scheme used in NTFS, so you are right, 4K pages and 16 as PagesPerCluster parameter value gives 64K blocks for compression.
Posted: 03/26/2014 05:15:05
by Simon King (Basic support level)
Joined: 03/24/2014
Posts: 17

So have I specified the root directory correctly, is this the recommended way to enable compression? Do you have any other parameter suggestions to optimize compression, or is the \ - zlib = 9 - 16 set appropriate?

Thank you.
Posted: 03/26/2014 05:23:11
by Alexander Plas (EldoS Corp.)

Yes, the provided code is correct, I've rechecked it.

The ZLib compression level should be selected depend on data in the file which should be compressed. If the compression doesn't save any page (4K block in 64K block) the data is stored uncompressed and the processor time used for the compression is just wasted. So, sometime it is better to use less compression level.



Topic viewed 2334 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!