Author | Topic: Monitor garbage collector | |
---|---|---|
Jack Duijf | Monitor garbage collector on Sat, 18 Aug 2018 20:52:18 +0200 Hello, Is there a way to monitor the garbage collector at runtime? Memwatch is not an option, the app runs at various enduser sites. (i have no direct access to the servers) It seems i have a memory leak somewhere, probably my own mistake. After 2-4 weeks of continues running the app, i encounter a FATAL error. Module: EXE Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 I would like to monitor the number of memory handles, the status of the garbage collectior (is it still running ?), and create a log file. Suggestions are welcome. Regards Jack Duijf ------------------------------------------------------------- Also a member off the XXP (http://www.xxp.nl) | |
Pavelas Pisarevskis | Re: Monitor garbage collector on Thu, 23 Aug 2018 09:43:14 +0300 On Sat, 18 Aug 2018 20:52:18 +0200, Jack Duijf wrote: > Hello, > > Is there a way to monitor the garbage collector at runtime? > Memwatch is not an option, the app runs at various enduser sites. (i have no direct access to the servers) > > It seems i have a memory leak somewhere, probably my own mistake. > After 2-4 weeks of continues running the app, i encounter a FATAL error. > Module: EXE > Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 > > I would like to monitor the number of memory handles, the status of the garbage collectior (is it still running ?), and create a log file. > > Suggestions are welcome. > Regards > Jack Duijf > > ------------------------------------------------------------- > Also a member off the XXP (http://www.xxp.nl) if for you is enough to have the same info as colleted in standard memwatch solution in log file, you can try this code: at start app ------------------------ nH := DllLoad( "memwatch.dll",, .t. ) oMW := DllCall( nH, ,"XbpMemwatch" ) oDlg := oMW:new():create():hide() oDlg:oLogTofile:SetData( .t. ) oDlg:oFileName:SetData( "aa.log" ) oDlg:ActivateLog() you can call this method in appropriate points in your code oDlg:LogInfo() at exit app -------------------------------- oDlg:oLogTofile:SetData( .f. ) oDlg:ActivateLog() oDlg:destroy() Additionally, logging of XPBʼs ( 1ʼst tab in memwatch window ) also is possible, but this has some impact to performance. (Read note about SyncGC button in memwatch.hlp ). Regards, Pavelas | |
Jack Duijf | Re: Monitor garbage collector on Thu, 23 Aug 2018 14:18:52 +0200 Hello Pavelas, Thank you for the code sample. I wil inplement this in my app. I hope this wil help me to find my memoty-leak. Jack On Thu, 23 Aug 2018 09:43:14 +0300, Pavelas Pisarevskis <pavelas.pisarevskis@vda.lt> wrote: >On Sat, 18 Aug 2018 20:52:18 +0200, Jack Duijf wrote: > >> Hello, >> >> Is there a way to monitor the garbage collector at runtime? >> Memwatch is not an option, the app runs at various enduser sites. (i have no direct access to the servers) >> >> It seems i have a memory leak somewhere, probably my own mistake. >> After 2-4 weeks of continues running the app, i encounter a FATAL error. >> Module: EXE >> Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 >> >> I would like to monitor the number of memory handles, the status of the garbage collectior (is it still running ?), and create a log file. >> >> Suggestions are welcome. >> Regards >> Jack Duijf >> >> ------------------------------------------------------------- >> Also a member off the XXP (http://www.xxp.nl) > > >if for you is enough to have the same info as colleted in standard memwatch >solution in log file, you can try this code: > > at start app ------------------------ > nH := DllLoad( "memwatch.dll",, .t. ) > oMW := DllCall( nH, ,"XbpMemwatch" ) > > oDlg := oMW:new():create():hide() > oDlg:oLogTofile:SetData( .t. ) > oDlg:oFileName:SetData( "aa.log" ) > oDlg:ActivateLog() > > you can call this method in appropriate points in your code > oDlg:LogInfo() > > at exit app -------------------------------- > oDlg:oLogTofile:SetData( .f. ) > oDlg:ActivateLog() > oDlg:destroy() > > >Additionally, logging of XPBs ( 1st tab in memwatch window ) also is >possible, but this has some impact to performance. >(Read note about SyncGC button in memwatch.hlp ). > >Regards, Pavelas > > | |
Jonathan Leeming | Re: Monitor garbage collector on Sun, 26 Aug 2018 11:45:44 -0600 On 8/23/2018 12:43 AM, Pavelas Pisarevskis wrote: > On Sat, 18 Aug 2018 20:52:18 +0200, Jack Duijf wrote: > >> Hello, >> >> Is there a way to monitor the garbage collector at runtime? >> Memwatch is not an option, the app runs at various enduser sites. (i have no direct access to the servers) >> >> It seems i have a memory leak somewhere, probably my own mistake. >> After 2-4 weeks of continues running the app, i encounter a FATAL error. >> Module: EXE >> Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 >> >> I would like to monitor the number of memory handles, the status of the garbage collectior (is it still running ?), and create a log file. >> >> Suggestions are welcome. >> Regards >> Jack Duijf >> >> ------------------------------------------------------------- >> Also a member off the XXP (http://www.xxp.nl) > > > if for you is enough to have the same info as colleted in standard memwatch > solution in log file, you can try this code: > > at start app ------------------------ > nH := DllLoad( "memwatch.dll",, .t. ) > oMW := DllCall( nH, ,"XbpMemwatch" ) > > oDlg := oMW:new():create():hide() > oDlg:oLogTofile:SetData( .t. ) > oDlg:oFileName:SetData( "aa.log" ) > oDlg:ActivateLog() > > you can call this method in appropriate points in your code > oDlg:LogInfo() > > at exit app -------------------------------- > oDlg:oLogTofile:SetData( .f. ) > oDlg:ActivateLog() > oDlg:destroy() > > > Additionally, logging of XPBʼs ( 1ʼst tab in memwatch window ) also is > possible, but this has some impact to performance. > (Read note about SyncGC button in memwatch.hlp ). > > Regards, Pavelas > > > Hi Pavelas, Thanks for the code. Can you tell me where I might find the MemWatch.hlp file? Thanks... Jonathan jonathan.leeming@the-family-centre.com Edmonton, Alberta, Canada | |
Andreas Gehrs-Pahl | Re: Monitor garbage collector on Sun, 26 Aug 2018 17:35:40 -0400 Jonathan, >Can you tell me where I might find the MemWatch.hlp file? The MemWatch.hlp file was included (in two versions) in (at least) six separate Xbase++ versions/releases -- all with identical content (besides the copyright dates and version/build numbers), including: 1.80.284, 1.82.293, 1.82.294, 1.90.322, 1.90.326, and 1.90.331. If you have a CD (or download) of any of those versions, you should have this help file, too. Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com [F]: https://www.facebook.com/AbsoluteSoftwareLLC | |
Peter Alderliesten | Re: Monitor garbage collector on Mon, 27 Aug 2018 10:20:28 +0200 Andreas, > The MemWatch.hlp file was included (in two versions) in (at least) six > separate Xbase++ versions/releases -- all with identical content (besides > the copyright dates and version/build numbers), including: 1.80.284, > 1.82.293, 1.82.294, 1.90.322, 1.90.326, and 1.90.331. You keep surprising me. Do you have all these versions live available? I have just the last 1.9 version installed (and have not used it for the last two, maybe even three years). Actually I think I would have a problem recreating this version with all the hotfixes etc. As for version 2.0, I only keep the builds that I installed with a release of my software. Peter | |
Andreas Gehrs-Pahl | Re: Monitor garbage collector on Thu, 30 Aug 2018 12:50:48 -0400 Peter, >You keep surprising me. Do you have all these versions live available? As a matter of fact, I do. I have all Xbase++ version (that I ever received) in separate directories, and can switch between them by simply renaming some directories. This includes beta versions that were time-limited and won't even work anymore. But the ability to compare versions, especially sample source code and the documentation, but also versions of DLLs and date/time stamps, etc., is a valuable resource. There is a lot that can be learned about Xbase++ and its historic development from comparing individual versions. And if there is an error or issue, it sometimes helps to test it with older versions to see if, and when, an issue first appeared and if, and when, it might have been fixed. Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com [F]: https://www.facebook.com/AbsoluteSoftwareLLC | |
Jonathan Leeming | Re: Monitor garbage collector on Mon, 27 Aug 2018 08:32:20 -0600 On 8/26/2018 3:35 PM, Andreas Gehrs-Pahl wrote: > Jonathan, > >> Can you tell me where I might find the MemWatch.hlp file? > > The MemWatch.hlp file was included (in two versions) in (at least) six > separate Xbase++ versions/releases -- all with identical content (besides > the copyright dates and version/build numbers), including: 1.80.284, > 1.82.293, 1.82.294, 1.90.322, 1.90.326, and 1.90.331. > > If you have a CD (or download) of any of those versions, you should have > this help file, too. > > Andreas > Thanks Andreas, I found it on my Alaska Software Volume 6SL1 Pro CD (ver 1.90.355). Not exactly a wealth of information but more than I had yesterday! I had not looked at that CD for a number of years but may revisit some of the material (there is a lot there) when I have some free time. Thanks once again... Jonathan jonathan.leeming@the-family-centre.com Edmonton, Alberta, Canada |