Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29234 Discussions

How to use VirtualAllocEx in CVF6.6?

Zhanghong_T_
Novice
620 Views
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
0 Kudos
3 Replies
Steven_L_Intel1
Employee
620 Views
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.)
0 Kudos
Zhanghong_T_
Novice
620 Views
Really?
Do you mean allocate itself calls VirtualAlloc sometimes?
Zhanghong Tang
0 Kudos
Steven_L_Intel1
Employee
620 Views
Yes.
0 Kudos
Reply