|
-
October 14th, 2004, 04:54 PM
#1
fread & system memory
I'm trying to read a big file (600Mo) by chunks of 1Mo on Linux (Suse 9.1). Like:
fp = fopen(...,"rb");
char buffer[1024*1024];
int read=1;
while (read > 0) {
read = fread(buffer,1,1024*1024,fp);
...
}
This works fine but the used memory (shown by top) grows until the system limit!!
I've removed buffering with setvbuf but still have the same problem.
Any idea ? Does the system have its own buffer when reading from file ?
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
|