PC Review


Reply
Thread Tools Rate Thread

How do I determine amount of memory I can have?

 
 
Terry Olsen
Guest
Posts: n/a
 
      22nd Jul 2005
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
that?

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)
Else
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 http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Amount of Memory Jasper Recto Windows Vista General Discussion 24 23rd Aug 2009 01:39 AM
Amount of memory rebust51 Windows XP Performance 2 13th Sep 2008 03:17 PM
Determine payback period to reach fixed dollar amount. =?Utf-8?B?SlA=?= Microsoft Excel Worksheet Functions 1 8th May 2007 09:16 PM
As I can determine the amount of BindingSource in a form Daniel R. Rossnagel Microsoft C# .NET 0 17th Nov 2005 07:47 PM
Reported Memory Does Not Match Amount of Installed Memory ON WINDOWS XP Anthony Windows XP Help 3 10th Dec 2003 02:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 AM.