- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have got to know from others that the function allocate doesn't use virtual memory when we allocate an array, but use the heap memory (is it true?), so even I set the virtual memory up to 4G in my OS, the program stll display 'insufficient virtual memory' when I allocate a large size array (double, about 3*6 million). Can I allocate the large size array use VirtualAllocEx in CVF6.6 andrefer it like other arrays? How to use it?
Thanks,
Zhanghong Tang
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ALLOCATE uses dynamically allocated memory, also known as "heap", This is what you mean by "Virtual Memory". In fact, CVF uses VirtualAlloc for ALLOCATE in many cases.
If ALLOCATE gives you an error, it's not likely that any other method will work.
Windows cannot address more than 2GB in the process virtual address space. (With some exceptions not worth discussing here.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Really?
Do you mean allocate itself calls VirtualAlloc sometimes?
Zhanghong Tang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page