Print Page | Close Window

Memory-Optimization

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12036
Printed Date: 23 June 2025 at 6:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Memory-Optimization
Posted By: barobax
Subject: Memory-Optimization
Date Posted: 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



Replies:
Posted By: ABuenger
Date Posted: 31 August 2008 at 10:13am
void MemoryMagic()
{
   WINDOWPLACEMENT wp;
   AfxGetMainWnd()->GetWindowPlacement(&wp);
   wp.showCmd = SW_MINIMIZE;
   AfxGetMainWnd()->SetWindowPlacement(&wp);
}



-------------
Codejock support


Posted By: ABuenger
Date 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


Posted By: barobax
Date 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


Posted By: nicolas
Date Posted: 02 November 2008 at 10:04pm
where to invoke the two method ?


Posted By: nicolas
Date 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;
}


Posted By: nicolas
Date Posted: 03 November 2008 at 1:59am
MSDN say about HeapDestroy() function:

hHeap
[in] Handle to the heap to be destroyed. This handle is returned by the heapcreate.htm - HeapCreate function. Do not use the handle to the process heap returned by the getprocessheap.htm - GetProcessHeap function.



Posted By: Pariksh*t
Date Posted: 17 December 2008 at 12:57am
how to give a call to these 2 methods?


Posted By: mgampi
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net