Problem : VFP 8 > Zlib.dll Compress function on large files causes memory error

Problem : VFP 8 > Zlib.dll Compress function on large files causes memory error

I have adapted a code example that does compression from within VFP, which I found at: http://www.tek-tips.com/faqs.cfm?fid=5400

It works great with all files at or less than 117 meg. But with any files larger than this, it errors out with Error #43: “There is not enough memory to complete this operation.”

I have tried this on multiple machines (one with as much as 2 gigs of ram) and received this same error.

Using sys(3050) I have tried both reducing the amount of memory allocated (in the case of the machines I tested on that had over a gig of ram) and increasing the memory allocated (in the case of machines I tested on that had just 512 mb of ram)

One thing I found strange when exploring the sys() memory related functions, is that for sys(1001) – which “Returns the total amount of memory available to the Visual FoxPro memory manager”, it always returns 1073741824, regardless of the amount of physical ram on the machine. This seems to be contrary to the sys(1001) vfp help remarks – “In Visual FoxPro, SYS(1001) returns the virtual memory pool size, which is approximately four times the amount of physical memory”

Does anyone know how I can increase the “virtual memory pool size” in Foxpro from beyond
1073741824? Or do you know another approach that might help me get around this memory error?


Solution : VFP 8 > Zlib.dll Compress function on large files causes memory error

Craig Boyd has worked extensively with Zlib and built a freeware FLL that  uses  ZLib at its basis.  He may have intimate knowledge of issues in the area you’re having.  Drop him an e-mail.

craig@sweetpotatosoftware.com

Updated VFP Compression FLL
http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,8decf02a-f5d2-4bfa-a885-b95824c6eed1.aspx

RE: Altered Source (that Mr. Boyd did)
http://www.zlib.net/zlib_faq.html#faq24