Application slow down/Memory Leak

Post Reply
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Application slow down/Memory Leak

Post by PeterHarmes »

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: Select all


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
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Re: Application slow down/Memory Leak

Post by MGA »

Thanks Peter...
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: Application slow down/Memory Leak

Post by toninhofwi »

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.
User avatar
mgsoft
Posts: 398
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: Application slow down/Memory Leak

Post by mgsoft »

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
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Re: Application slow down/Memory Leak

Post by MGA »

Hello PeterHarmes,

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

Thanks
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Application slow down/Memory Leak

Post by Silvio »

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
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Re: Application slow down/Memory Leak

Post by MGA »

thanks
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
Post Reply