Jump to content
Tuts 4 You

de-allocate memory necessary?


Recommended Posts

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?

Link to comment



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?). :)



Link to comment

If you deallocate memory the less likely the OS needs to perform paging commit and that requires disk access and it will be slow

Link to comment

thanks people.


so i used VirtualAlloc to allocate memory, which api do i need to de-allocate this memory?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...