|
-
Sep 20th, 2007, 09:02 PM
#1
Thread Starter
Lively Member
maximum array size
hey guys
i was experimenting with writing some simple encryption program with help and advice from randem!!
anyway what the prog does is read in a file into a byte array
so that for a file of 10 bytes the array has 10 entries
so just there i tried to encrypt a film on my computer and got
runtime error 7 out of memory
when i clicked debug the array which was to contain all the bytes showed up yellow
so i did a quick serach to see how big an array can be
and came across (2^31)-1 which is just over 2 billion.
but my film was only 1gb which is 1 billion bytes which should fit within an array with a capacity of over 2 billion entries?
its not an issue with my system ram as i have 2gb of ram?
anyway i would be interested to hear any insights on this.
i have a feeling that i could rewrite it so that the array only loads in 100mb at a time, does its work, then loads in the next 100mb etc etc etc. i suppose that approach would be better! in case i want to encrypt a 10gb file!!
let me know what you know!! cheers-jim
-
Sep 20th, 2007, 09:10 PM
#2
Re: maximum array size
It sounds like it is running an infinite loop or something. If the array was out of memory it would say overflow. Try debuging to see where it is snagging.
If a post has been helpful please rate it. 
If your question has been answered, pull down the tread tools and mark it as resolved.
-
Sep 20th, 2007, 09:12 PM
#3
Thread Starter
Lively Member
Re: maximum array size
i dont think its an infinite loop, it works fine for smaller files, i've just tested a zip archie which is 150mb, i'm pretty sure that the array has run out of space, just wondering if anyone else had experienced it!
-
Sep 21st, 2007, 08:21 PM
#4
Re: maximum array size
You would need to read the file into smaller chunks to process and loop thru the file until all chunks are done. Then it would process all size files.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|