Application Slowdown

Application Slowdown

Postby PeterHarmes » Wed Jan 26, 2011 11:15 am

Hi,

I dont think this is a FiveWin problem, but I will ask the question here..

At one of my customers (who have 6 installations), my application gets slower and slower as they use it through the day - if they go out of the application and go back in the application runs at normal speed.

They cannot tell me what causes the slowdown as they do many things in the application.

Is there any reporting tools to see what could be causing the slowdown (memory/resources etc)

I'm not expecting a "do this to fix" response, just ideas

I have posted this on the xHarbour forums but havent had any replies

I'm using xHarbour commercial June 2010 & SQLRDD , FWH 06.10

Any ideas would be appreciated

Best regards,

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

Re: Application Slowdown

Postby ukservice » Wed Jan 26, 2011 11:49 am

Hi,

Please add SetResDebug( .T. ) al the start of your app and CheckRes() before exiting.

Also, I have noticed that soemtimes FWH loses bitpams in RIBBON BAR.

Hope it helps
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: Application Slowdown

Postby PeterHarmes » Wed Jan 26, 2011 11:58 am

I see that it creates a res.log - what does the contents show me?

This forum is so much better than the xHarbour commercial forum - i posted my first message on there in June 2010 and have yet to receive any suggestions - on here i have help in just over half an hour
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Application Slowdown

Postby ukservice » Wed Jan 26, 2011 12:07 pm

The controls that have not been propely ended.

I think the best compiler is Harbour and of course, this forum is the best support for Harbour Guis.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: Application Slowdown

Postby ukoenig » Wed Jan 26, 2011 12:16 pm

Hello Peter,

You can use this free Tool, to check and optimize the memory to find out Problems
of running Applications without any changes of Your own Application.
It runs in the Background and can optimize the Memory in Intervall and shows the used Memory.
Maybe another running Application is the Reason for the memory-problems.
Before You start, to check inside Your Application, You can do a Test with this Tool,
because on several other Customer-Computers it is working fine ?

All Tools :
http://www.rizone3.com/

Memory-Booster :
http://www.rizone3.com/archives/27

This method will not free up a big amount of RAM, but instead will,
improve the stability and performance of your computer.
This will also cure memory leaks and in some cases has been able to unfreeze programs.
Because it uses a Windows API call, you know that it’s safe to run.
You don’t need to install Memory Booster.
Just unzip the files to your desired location and run ‘MemBoost.exe’.
Memory Booster stores all settings in the application folder and will not write anything to the Registry.

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Wed Jan 26, 2011 12:48 pm, edited 8 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Application Slowdown

Postby PeterHarmes » Wed Jan 26, 2011 12:17 pm

The trouble is that we have invested a lot of development into SQLRDD so we have to use xHarbour

Thats a bit worrying - i open my app and close is straight away and I have a file with 66 lines in - all the app is doing at that stage is opening tables, opening a buttonbar and displaying a bitmap - i noticed that there is a line with brush and as far as i know i dont use any brushes in this app
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Application Slowdown

Postby driessen » Wed Jan 26, 2011 12:19 pm

Pete,

Maybe you should update your FWH. Your version is already 5 years old.

I have some customers by whom my application is used by more than 30 users on their network. If I remember well, I once had a similar problem but that dissappeared after an update of FWH.

Often that kind of problems are caused by the antivirus software used by your customer. You should try to disable the antivirus software and check if some different behaviour is experienced.

Good luck.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Application Slowdown

Postby PeterHarmes » Wed Jan 26, 2011 12:23 pm

Sorry got the numbers around the wrong way for the FW version should be 10.06 :lol:

I can ask about the AV, but they are a big company and probably wont allow to turn off the AV
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Application Slowdown

Postby Richard Chidiak » Wed Jan 26, 2011 1:24 pm

Peter

I went through a similar situation and i monitored the resources

At the beginning of my application i have (it is still there)

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

When i go into a similar situation , i make the user press f11 and send me the file

Checking the file, one of my printing programs was not releasing a font and that was the problem when this function was used often and often during the day

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 Jan 26, 2011 3:40 pm

I Have searched all of my source code and i do not use a brush yet the res.log file says that there are three - is there a way of releasing these or do i have to find where in the code these are being defined?
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: Application Slowdown

Postby James Bott » Wed Jan 26, 2011 5:27 pm

Peter,

I Have searched all of my source code and i do not use a brush yet the res.log file says that there are three - is there a way of releasing these or do i have to find where in the code these are being defined?


This is most likely a bug in the FWH code. One way to isolate where it is happening is to comment out about half of the code you are running, then test again. This will tell you which half of your code is causing the problem. Then comment out half of the problem code to isolate it to 1/4 of your code. Eventually you will find the line(s) causing the problem and then you can try to find what FW source contains the bug.

RE: Antivirus software
From your description of increasing slowness I don't think this is your problem but be advised that AV software should be set to ignore databases and indexes. Otherwise every time a record is saved the entire database will be scanned.

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 ukservice » Wed Jan 26, 2011 8:29 pm

Hi,

I have set up SetResDebug( .T. ) and Checkres() to, for example, ribbon2.prg sample and there are many objects not released.

Why does occur?.

I beleived FWH handles that!!


Thank you-
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: Application Slowdown

Postby James Bott » Thu Jan 27, 2011 1:38 am

UKService,

I looked at the fw\samples\ribbon2.prg example and there is some poor coding in it. It does not release a number of fonts, brushes, and bitmaps that it creates. This has nothing to do with the ribbonbar class and its associated classes.

If you have defined your ribbonbar similarly to ribbon2.prg then perhaps you have the same problem. Mainly there are several NOWAIT dialogs that are defined in functions using LOCAL fonts, brushes, and bitmaps. These resources need to be destroyed when the main app is ended but the locals cannot be accessed by the main app.

The best solution would probably to write the app as a class and have three arrays as data of the app; one array for fonts, one for brushes and one for bitmaps. Then the End() method of the app class could destroy all these resources.

HOWEVER, I don't think this is the reason for your app slowing down. These resource are only defined once per application run. I think you have resources that are defined every time a certain function or routine is called and those resources are never released.

Here is a test. Add checkres() to the end of your app. Open the app, then immediately close it. Ideally, there should be no unreleased resources in the file, but if there are, just ignore them for now. Keep a copy of the checkres() file. Now, run the app again and perform several routines, then close it again. Now compare the previous and current checkres.txt files. I expect you are going to see some new resources that were not in the first file. These are part of the problem.

You can isolate certain routines by erasing the checkres.txt file at the beginning of the routine, and calling checkres() at the end of the routine.

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 » Thu Jan 27, 2011 10:21 am

OK, I have done some tests by placing SetResDebug( .T. ) before a routine and CheckRes() after, here are my findings:

A routine that just calls Msginfo() creates a res.log that contains this:

Code: Select all  Expand view


          0
BRUSH
          0

          0

          0

          0

          0

          0

          0

          0

          0


 



I then placed the code before and after i open a dialog that contains a listbox and three BTNBMP with a bitmap from resource, this returns this:

Code: Select all  Expand view


          0
BRUSH
          0
BMP
          0
PAL
          0
BMP
          0
PAL
          0
BMP
          0
BRUSH
          0

          0

          0

 

If i comment out the BTNBMP, i get this:

Code: Select all  Expand view


          0
BRUSH
          0

          0

          0

          0

          0

          0

          0

          0

          0


 



So i would say that BTNBMP (and maybe Msginfo) is leaving something behind - should i be destroying the BTNBMP somehow (if so, how?) after i close the dialog?

Any advice would be appreciated

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

Re: Application Slowdown

Postby James Bott » Thu Jan 27, 2011 12:53 pm

Pete,

I then placed the code before and after i open a dialog


If you are calling checkres() before the dialog is closed then it is meaningless. You have to call it AFTER the dialog is closed.

Did you try my other tests?

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests