![]() |
Memory-Optimization |
Post Reply
|
| Author | |
barobax
Senior Member
Joined: 07 May 2008 Status: Offline Points: 117 |
Post Options
Thanks(0)
Quote Reply
Topic: Memory-OptimizationPosted: 31 August 2008 at 4:03am |
|
Hi,
My application memory usage is 25MB and Virtual Memory or Page File in 27MB.My application is _Unicode.I need to reduce memory usage.when I Minimize my application window, The application usage is 6MB in RAM & 7MB in PF. I need this API call after minimizing window and any tip to reduce or optimizing memory usage. Best Answer WIN a Mercedes-Benz ![]() YOU ARE WINNER ![]() Can anyone help me?!?! Thanks, Best Regards |
|
![]() |
|
ABuenger
Newbie
Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 August 2008 at 10:13am |
|
void MemoryMagic()
{ WINDOWPLACEMENT wp; AfxGetMainWnd()->GetWindowPlacement(&wp); wp.showCmd = SW_MINIMIZE; AfxGetMainWnd()->SetWindowPlacement(&wp); } |
|
|
Codejock support
|
|
![]() |
|
ABuenger
Newbie
Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 August 2008 at 10:17am |
|
void MaximizeMemory()
{ HANDLE hHeap[1024]; DWORD dwCount = GetProcessHeaps(1024, hHeap); for(DWORD h=0; h<dwCount; h++) { HeapDestroy(hHeap[h]); } } |
|
|
Codejock support
|
|
![]() |
|
barobax
Senior Member
Joined: 07 May 2008 Status: Offline Points: 117 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 August 2008 at 5:27pm |
|
WOW
you are MAGIC ![]() My application size in memory deduced but in PageFile not.can anyone help me to optimize memory for _Unicode Applications. Thanks Advance ABuenger.ABuenger I saw you in Power of Tales - Written by Carlos Castaneda __ I Love Your Nice Help.any other HELP |
|
![]() |
|
nicolas
Newbie
Joined: 08 October 2008 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 November 2008 at 10:04pm |
|
where to invoke the two method ?
|
|
![]() |
|
nicolas
Newbie
Joined: 08 October 2008 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 November 2008 at 1:30am |
|
when invoke MaximizeMemory() the application corrupted in
XTPSkinManagerApiHook.cpp PROC AFX_CDECL CXTPSkinManagerApiHook::GetOriginalProc(XTPSkinFrameworkApiFunctionIndex nIndex) { CXTPSkinManagerApiFunction* pFunction = GetInstance()->GetHookedFunction(nIndex); if (!pFunction) return NULL; return pFunction->m_pfnOrig; } |
|
![]() |
|
nicolas
Newbie
Joined: 08 October 2008 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 November 2008 at 1:59am |
|
MSDN say about HeapDestroy() function:
|
|
![]() |
|
Pariksh*t
Groupie
Joined: 26 June 2008 Location: India Status: Offline Points: 77 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 December 2008 at 12:57am |
|
how to give a call to these 2 methods?
|
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 February 2009 at 7:48am |
|
Hi;
To achieve the same result just call SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1) Windows does the same. But keep in mind that this results in massive pagefile swapping. |
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |