FastLife Posted June 1, 2014 Share Posted June 1, 2014 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
LCF-AT Posted June 1, 2014 Share Posted June 1, 2014 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 Link to comment
Lostin Posted June 1, 2014 Share Posted June 1, 2014 It's all about RAM and not the CPU. Link to comment
xSRTsect Posted June 1, 2014 Share Posted June 1, 2014 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
FastLife Posted June 4, 2014 Author Share Posted June 4, 2014 thanks people. so i used VirtualAlloc to allocate memory, which api do i need to de-allocate this memory? Link to comment
Loki Posted June 4, 2014 Share Posted June 4, 2014 VirtualFree VirtualFree(pointer_to_your_allocated_memory, NULL, MEM_RELEASE); http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx 1 Link to comment
FastLife Posted June 6, 2014 Author Share Posted June 6, 2014 thank you guys gonna try it! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now