Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to track down memory leak(s)
Message
 
 
To
27/09/2011 10:04:07
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01398453
Message ID:
01524856
Views:
106
Thomas,

Before making such judgemental remarks, I think you should have been in the environment. After I became a bit more familiar with the code and the other classes that are based on this same class, I think the code was correct. In the main method (Invoke) which is always used when any method of this class is called from outside all other classes are re-setting this property. This particular class was the only one there this line was not present (may be an accidental deletion or oversight). I think I should have been able to find it out earlier if I'd done more thorough comparison. I was very close to the solution, though, as I did determine (after much trial and many messages here) that the problem was in the write_log method. I did (and Gregory) found that there was an ever incrementing property. There was the most logical next step, which I didn't do completely on my own - it was found by my colleague.

The reason for this ever incrementing property as we want to show complete info in case of the error. (everything that was done in Invoke method prior to the error). But of course, it has to be re-set on each new invoke call.

>>So, the problem was indeed there. I guess the only change that needs to be done is to add this line to the main program and all will work fine. Of course, I made lots of other little tweaks which my colleagues seem to want to not implement for now.
>
>If you look at that statement, it becomes clear that you and your colleagues don't follow
>DRY hard enough. Such a line should *never* be needed to be added in the main program:
>It should be in the setup of the class code of the logger. Or at least in the function opening the file.
>
>Also if you had class based logging, any tweak done in the base class would not need to be implemented again ;-)
>So that anti-pattern incurred the cost of you trying to find the reason for the perf loss and did not get the benefit
>of streamlined routines except for the specific case.
>
>In my code there are a couple of different loggers working - sometimes adding info for
>memory state,
>tabel size/usage
>disk info
>stack level,
>specififc time incurred (SQL)
>time incurred vs. _tally
>
>and other things.
>
>regards
>
>thomas
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform