By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,835 Members | 964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,835 IT Pros & Developers. It's quick & easy.

How do I determine amount of memory I can have?

P: n/a
Using #ZipLib, I'm zipping up large files (100MB & >). I'm using a byte
array to read in the file and write out to the zip file. The bigger the
chunks I can read in the faster the zipping goes. What's the best way
to determine how big I can make the byte array? I'm guessing that I
would determine the amount of available memory and take a percentage of

OR: does anyone have any code using #ZipLib that demonstrates how to zip
files of any size?

The error I'm getting is:
Insufficient system resources exist to complete the requested service.

Here's the code I'm using:
dim buffer(33554432) as Byte '32MB Buffer
While fs.Position < fs.Length
If (fs.Position + 33554432) < fs.Length Then
fs.Read(buffer, 0, buffer.Length)
s.Write(buffer, 0, buffer.Length)
Dim rdlen As Long = fs.Length - fs.Position
fs.Read(buffer, 0, rdlen)
s.Write(buffer, 0, rdlen)
End If
End While

*** Sent via Developersdex ***
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.