-
July 23rd, 2012, 04:20 PM
#1
malloc virtual memory
Hi
When does malloc() return null ? I want to allocate a big virtual memory which can not possibly fit on RAM, so most of it will be stored on disk. I am going to access the data sequentially so at any one time the data I am working on will fit in RAM. So I am hoping the OS will help in moving the required pages in and out of disk. I can achieve this behavior manually by allocating the required blocks on RAM but this is rather tedious. Say I have an array a[100][10000000000]. At any one time I am working only on a[i-1][], a[i][], a[i+1][] which can fit in RAM but not the whole array. So how do I allocate the array so that I can work on it using for loops for(i=0;i<100;i++) without handling the page movements myself?
thanks
-
July 23rd, 2012, 04:40 PM
#2
Re: malloc virtual memory
Originally Posted by dshawul
... I have an array a[100][10000000000].
Is it on a 64-bit system?
Victor Nijegorodov
-
July 23rd, 2012, 04:45 PM
#3
Re: malloc virtual memory
Yes with address space of 2^64.
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
|