Posted June 1, 201411 yr i allocated memory using VirtualAlloc. this i have done 9 times.now i don't need those memory anymore so do i have to free/remove them to improve the application's cpu? i mean, i know when the application is gonna terminate, all memory will be freed, but while the application is running, and i don't need the allocated memory anymore, is it better to remove/free that memory to have a lower pcu usage or something?
June 1, 201411 yr Hi, sure its better to free the memory again if you don't need it anymore.So if user XY used a low level PC with less memory then user XY PC's is getting slower.Also a question how much sizes you alloc (don't think that you wanna alloc 9x 500 MB VirtualMemory or?). greetz
June 1, 201411 yr If you deallocate memory the less likely the OS needs to perform paging commit and that requires disk access and it will be slow
June 4, 201411 yr Author thanks people. so i used VirtualAlloc to allocate memory, which api do i need to de-allocate this memory?
June 4, 201411 yr VirtualFree VirtualFree(pointer_to_your_allocated_memory, NULL, MEM_RELEASE); http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx
Create an account or sign in to comment