FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Application slow down/Memory Leak
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Application slow down/Memory Leak
Posted: Fri Mar 18, 2011 11:54 AM
Hi,

One of my customers have been experiencing a performance drop in our application and after a few tests, we have noticed that the slow down occurs when the Mem Usage (reported by task manager) reaches a certain figure.

I noticed that I could open a simple dialog box and close it and the memory would increase and would never be recovered. The dialog box opened is very simple - One Say and a button - no fonts or bitmaps used.

Uwe sent me a memory application that when run, my users said that it seemed to help with performance, so I have tried to create my own version of the application withing my application:

The code for this is:

Code (fw): Select all Collapse
FUNCTION MemoryFlush 
    SetProcess( -1, -1, -1)
RETURN NIL

DLL32 Function SetProcess( ;
   hWnd As LONG, nMinWorkingSpace As LONG, nMaxWorkingSpace As LONG ) ;
   As LONG PASCAL From "SetProcessWorkingSetSize" Lib "Kernel32.dll"



I then call MemoryFlush() within a common routine (in my app, the routine that reads my text data dictionary)

So far, we have tested tmy app in a test environment with a single user and it seems to work quite well - I noticed that the mem usage value was being clawed back.

We are now testing my app in a live environment, so I will let you all know if we have any success.

If this is successful, I would like to change my memoryflush routine to only run if the memory usage is over a set value - does anyone know how get the mem usage value of your application?

Regards,

Pete
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Application slow down/Memory Leak
Posted: Sat Mar 19, 2011 02:11 PM

Thanks Peter...

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Application slow down/Memory Leak
Posted: Sun Mar 20, 2011 03:58 PM

Hi Pete.

Thanks for share it.

>does anyone know how get the mem usage value of your application?

Please review: \harbour\tests\memtst.prg

Toninho.

Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: Application slow down/Memory Leak
Posted: Mon Mar 21, 2011 01:27 PM

Peter,

What is the reason of the memory high use?.

Have you checked with Checkres() if there are any memory leaks?.

Thank you for your important point.

Saludos,



Eduardo
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Application slow down/Memory Leak
Posted: Fri May 13, 2011 08:21 PM

Hello PeterHarmes,

In their tests in a real environment, you have succeeded in using the function: memoryflush?

Thanks

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Application slow down/Memory Leak
Posted: Sun May 15, 2011 01:03 PM

one of problems are resources specialy on windows seven systems

to resolve this leak problems I not use resources

only for bitmaps but If I can i save the bitmaps on a folder and call them when I use them

I rewrite also rpreview dialogs into @x,y source

I use only freeimage.dll calls

Best Regards, Saludos



Falconi Silvio
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Application slow down/Memory Leak
Posted: Mon May 16, 2011 11:01 AM

thanks

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin

Continue the discussion