Application Slowdown

Re: Application Slowdown

Postby PeterHarmes » Thu Jan 27, 2011 1:01 pm

Yes i did put checkres after the dialog is closed - sorry wasnt clear
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Application Slowdown

Postby James Bott » Thu Jan 27, 2011 1:11 pm

When I look at the TBtnbmp class it does appear that all the bitmaps are being released. I suggest building the smallest test program you can with just a dialog and a btnbmp and seeing if all the bitmaps are being released. If they are not, please post your test program here.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Application Slowdown

Postby Richard Chidiak » Thu Jan 27, 2011 4:31 pm

Peter

There were some cases in previous fwh releases where fonts and brushes were not correctly released, concerning xbrowse, gets..etc

This was fixed in fwh 10.9 and upwards

If you can upgrade from 10.6 , i think it can help solving your problem

On another hand concerning the checkres file, i do not use setresdebug just the checkres and the reading of the file is very clear, program and line n°, it helped me fixing memory consuption issues in my application.

HTH

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Application Slowdown

Postby PeterHarmes » Fri Jan 28, 2011 9:08 am

Richard,

can you show me an example of your code where you use checkres as when i tried nothing happened.

I'm not sure i can upgrade from 10.06 yet as future versions caused me some display problems - see viewtopic.php?f=3&t=19786&start=0
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Application Slowdown

Postby Richard Chidiak » Fri Jan 28, 2011 11:58 am

Peter

At the very beginning of my application this is what i have

SetKey( VK_F11, { || FERASE("CHECKRES.TXT"),CHECKRES() } )

when i want to check the resources , i press F11 and get the file

Hth

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Application Slowdown

Postby PeterHarmes » Wed Mar 02, 2011 11:56 am

Uwe,

My customers have installed the software and have noted that it has improved performance - is there any way of doing what this app is doing programtically?

As I cant upgrade FW, i cant see if the latest memory leaks are actually the cause and if it will help the problems im getting

Best regards,

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

Re: Application Slowdown

Postby James Bott » Wed Mar 02, 2011 3:00 pm

Pete,

>My customers have installed the software and have noted that it has improved performance - is there any way of doing what this app is doing programatically?

I assume you are referring to the memory monitoring software that Uwe suggested? If so, then there is nothing similar built into FW.

>As I cant upgrade FW, i cant see if the latest memory leaks are actually the cause and if it will help the problems im getting.

You can be sure that memory leaks will slow down a computer, and many apps (not just FW apps) have memory leaks so over time, a computer will get slower. Regular reboots will help. More RAM will also help by delaying the effects. You can set computers to reboot automatically during the night (timed so they are not doing backups, etc.).

You may have also introduced memory leaks yourself in your code (we all do it). When you define fonts, bitmaps, etc. you have to remember to End() them too. You can look through your code for such problems.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Application Slowdown

Postby PeterHarmes » Wed Mar 02, 2011 3:54 pm

Hi James,

I recently went through my code and made sure I was ending all my defined fonts. I don't use many bitmaps in my app except on BtnBmps - do you think i should end these when i close any dialogs? (please say no!!)

I have just written a small routine that i call when the dialog is closed (in the valid clause):

Code: Select all  Expand view


FUNCTION CompleteEnd(oDlg)   
    LOCAL nCount  := 0
    LOCAL lFolder := .F.
    LOCAL oFolder

    //First check to see if there is a folder within the dialog 
    FOR nCount := 1 TO Len(oDlg:aControls)
        IF Alltrim( Upper( oDlg:aControls[nCount]:Classname() ) ) == "TFOLDER"
            lFolder := .T.
            oFolder := oDlg:aControls[nCount]
        ENDIF  
    NEXT
    IF lFolder
        //Folder Exists, End objects within folders
        FOR nCount := 1 TO Len(oFolder:aDialogs)           
            Aeval(oFolder:aDialogs[nCount]:aControls,{|o| IF(o <> NIL, (Msginfo("FOLDER " + o:ClassName()), o:End()), .T.)})
        NEXT
    ENDIF  
    //End objects within dialog
    Aeval(oDlg:aControls,{|o| IF(o <> NIL, (Msginfo(o:ClassName()), o:End()), .T.)})
RETURN NIL

 


I noticed that when my routine showed which object was being ended, it was only removing every other object. For example, if the dialog had 6 tSay objects, the first, third and fifth tSay object would end!! - Would the above code help to remove any objects remaining open in a dialog or am i barking up the wrong tree? Could this be demonstrating that when a dialog is closed, not all the objects are being destroyed properly?

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

Re: Application Slowdown

Postby James Bott » Wed Mar 02, 2011 4:28 pm

Pete,

Barking up the wrong tree.

Controls are ended automatically when the parent is ended. The controls themselves are supposed to end any resources they are using. If a control is not ending all the resources it is using, you ending it before closing the parent is not going to help--it is a bug in the control. The issue is not that the parent is not ending the control, but rather the control is not ending the resource or resources.

Remembering to end resources that you have initiated in your code will help since there is no way for FW to automatically do this.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 10 guests