![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
So, I said all that to say this. "Something" with BTrieve is causing the memory leak. |
#3
| |||
| |||
|
|
I have an issue with BTrieve (Pervasive 2000i) that I have narrowed down to either the BTrieve engine or the Win32 BTrieve client. A bit of history: Win2K system (Schedule system) Novell Server v6 Object Rexx programming language Schedule system runs a single program we'll call ProgramA. This program wakes up every 30 seconds to check the records in a BTrieve file to see if it has anything scheduled for the current day/time. If it does, it calls ProgramB. ProgramB will do extensive reading on multiple BTrieve files. What we are witnessing is that over a period of time, all ProgramB's called by ProgramA get slower and slower. This morning I used a utility to check the memory in use by the thread ProgramA was running in. It was in excess of 132MB. A simple close of the window ProgramA was running in and reopening the window resulted in a memory usage of 3.2 MB. Trust me, I have done extensive testing and everything points to BTrieve. I set up a test system and have been running the same ProgramB on it for several weeks. After assuring myself that I could recreate the problem, I began changing ProgramB trying to eliminate any possible causes of the memory leak. BTW: I copied my databases used in ProgramB to a seperate server folder so I would be testing on the same data on every run. Here's what I tried: 1) Removed all ActiveX components from ProgramB (this was primarily a component to print data to a PDF file). Still witnessed memory leak. 2) Removed all ::Requires statements from the code. A Requires statement in Object Rexx simply allows the program to access classes and methods in an external routine. Still witnessed memory leak 3) Exported all data from the BTrieve files into delimeted text files - modified program to read text files vs. BTrieve files - removed all BTrieve calls. Memory leak went away!! So, I said all that to say this. "Something" with BTrieve is causing the memory leak. It could be any one of the following: 1) The BTrieve API calls developed for Object Rexx, but in extensive conversation with the author of these API calls, he assures me that practically all memory usage is static with very little dynamic allocation. 2) The Win32 Btrieve client 3) The NetWare BTrieve Engine, I have my doubts about it being the engine since we also have several OS/2 systems accessing the same data and never have a slow down or memory issue with them. My next experiment will be to load an old work station version of BTrieve that I still have laying around and run everything local. If anyone has any ideas or suggestions, I'm all ears. (I don't have much hair left). Lee Peedin |
#4
| |||
| |||
|
|
Since the client is on one machine and the engine is on another you should be able to discount the engine (3) as a source of problems. While I have never heard of any kind of memory leak with the Btrieve API client (which version by the way?) it is possible. But again I have not seen this behavior even in very high volume environments. Now the fact that you are looking for a memory leak and the developer of the Rexx interface has said "very little dynamic allocation" leads me to believe that they are more likely related. Because even a tiny bit of dynamic memory allocation will build up over time if not released. You may want to check with them to see when (what triggering conditioins) they dynamically release the memory they dynamically allocate. If he can't give you an answer that would probably be it. If he does give you an answer and you are not performing the triggering event, for example closing the session which is different than closing all files, then it might just be a simple change. The problem is you are not actually making Btrieve API calls. You are making Rexx driver calls which is hopefully being properly translated to the Btrieve API. There may be a disconect in there somewhere. Pehaps check the Pervasive monitor utility an see if file handles or sessions are piling up on the server. If you are closing them and they are not going away that can be a problem. Likewise opening and closing files are the most "expensive" database operations you can do. Normally just open them at the beginning of the application and close them at the end and oh by the way close the session too with a Stop(25) or Reset(28) call. If you really want to know what is happening at the database level you can turn on database engine tracing which traces all of the operations in / request and out / response of the database engine. Be sure to turn tracing off when done though. You mention bypassing the Btrieve API, maybe bypass the Rexx supplied "driver" if possible. The Btrieve API is just a DLL function call that is well documented. Sof if Rexx allows you to call DLLs directly that might be an option also. Leonard On Thu, 10 Feb 2005 01:21:03 GMT, Lee Peedin lpeedinREMOVE (AT) UPPERCASEnc (DOT) rr.com> wrote: I have an issue with BTrieve (Pervasive 2000i) that I have narrowed down to either the BTrieve engine or the Win32 BTrieve client. A bit of history: Win2K system (Schedule system) Novell Server v6 Object Rexx programming language Schedule system runs a single program we'll call ProgramA. This program wakes up every 30 seconds to check the records in a BTrieve file to see if it has anything scheduled for the current day/time. If it does, it calls ProgramB. ProgramB will do extensive reading on multiple BTrieve files. What we are witnessing is that over a period of time, all ProgramB's called by ProgramA get slower and slower. This morning I used a utility to check the memory in use by the thread ProgramA was running in. It was in excess of 132MB. A simple close of the window ProgramA was running in and reopening the window resulted in a memory usage of 3.2 MB. Trust me, I have done extensive testing and everything points to BTrieve. I set up a test system and have been running the same ProgramB on it for several weeks. After assuring myself that I could recreate the problem, I began changing ProgramB trying to eliminate any possible causes of the memory leak. BTW: I copied my databases used in ProgramB to a seperate server folder so I would be testing on the same data on every run. Here's what I tried: 1) Removed all ActiveX components from ProgramB (this was primarily a component to print data to a PDF file). Still witnessed memory leak. 2) Removed all ::Requires statements from the code. A Requires statement in Object Rexx simply allows the program to access classes and methods in an external routine. Still witnessed memory leak 3) Exported all data from the BTrieve files into delimeted text files - modified program to read text files vs. BTrieve files - removed all BTrieve calls. Memory leak went away!! So, I said all that to say this. "Something" with BTrieve is causing the memory leak. It could be any one of the following: 1) The BTrieve API calls developed for Object Rexx, but in extensive conversation with the author of these API calls, he assures me that practically all memory usage is static with very little dynamic allocation. 2) The Win32 Btrieve client 3) The NetWare BTrieve Engine, I have my doubts about it being the engine since we also have several OS/2 systems accessing the same data and never have a slow down or memory issue with them. My next experiment will be to load an old work station version of BTrieve that I still have laying around and run everything local. If anyone has any ideas or suggestions, I'm all ears. (I don't have much hair left). Lee Peedin |
#5
| |||
| |||
|
|
Since the client is on one machine and the engine is on another you should be able to discount the engine (3) as a source of problems. While I have never heard of any kind of memory leak with the Btrieve API client (which version by the way?) it is possible. But again I have not seen this behavior even in very high volume environments. Now the fact that you are looking for a memory leak and the developer of the Rexx interface has said "very little dynamic allocation" leads me to believe that they are more likely related. Because even a tiny bit of dynamic memory allocation will build up over time if not released. You may want to check with them to see when (what triggering conditioins) they dynamically release the memory they dynamically allocate. If he can't give you an answer that would probably be it. If he does give you an answer and you are not performing the triggering event, for example closing the session which is different than closing all files, then it might just be a simple change. The problem is you are not actually making Btrieve API calls. You are making Rexx driver calls which is hopefully being properly translated to the Btrieve API. There may be a disconect in there somewhere. Pehaps check the Pervasive monitor utility an see if file handles or sessions are piling up on the server. If you are closing them and they are not going away that can be a problem. Likewise opening and closing files are the most "expensive" database operations you can do. Normally just open them at the beginning of the application and close them at the end and oh by the way close the session too with a Stop(25) or Reset(28) call. If you really want to know what is happening at the database level you can turn on database engine tracing which traces all of the operations in / request and out / response of the database engine. Be sure to turn tracing off when done though. You mention bypassing the Btrieve API, maybe bypass the Rexx supplied "driver" if possible. The Btrieve API is just a DLL function call that is well documented. Sof if Rexx allows you to call DLLs directly that might be an option also. Leonard On Thu, 10 Feb 2005 01:21:03 GMT, Lee Peedin lpeedinREMOVE (AT) UPPERCASEnc (DOT) rr.com> wrote: I have an issue with BTrieve (Pervasive 2000i) that I have narrowed down to either the BTrieve engine or the Win32 BTrieve client. A bit of history: Win2K system (Schedule system) Novell Server v6 Object Rexx programming language Schedule system runs a single program we'll call ProgramA. This program wakes up every 30 seconds to check the records in a BTrieve file to see if it has anything scheduled for the current day/time. If it does, it calls ProgramB. ProgramB will do extensive reading on multiple BTrieve files. What we are witnessing is that over a period of time, all ProgramB's called by ProgramA get slower and slower. This morning I used a utility to check the memory in use by the thread ProgramA was running in. It was in excess of 132MB. A simple close of the window ProgramA was running in and reopening the window resulted in a memory usage of 3.2 MB. Trust me, I have done extensive testing and everything points to BTrieve. I set up a test system and have been running the same ProgramB on it for several weeks. After assuring myself that I could recreate the problem, I began changing ProgramB trying to eliminate any possible causes of the memory leak. BTW: I copied my databases used in ProgramB to a seperate server folder so I would be testing on the same data on every run. Here's what I tried: 1) Removed all ActiveX components from ProgramB (this was primarily a component to print data to a PDF file). Still witnessed memory leak. 2) Removed all ::Requires statements from the code. A Requires statement in Object Rexx simply allows the program to access classes and methods in an external routine. Still witnessed memory leak 3) Exported all data from the BTrieve files into delimeted text files - modified program to read text files vs. BTrieve files - removed all BTrieve calls. Memory leak went away!! So, I said all that to say this. "Something" with BTrieve is causing the memory leak. It could be any one of the following: 1) The BTrieve API calls developed for Object Rexx, but in extensive conversation with the author of these API calls, he assures me that practically all memory usage is static with very little dynamic allocation. 2) The Win32 Btrieve client 3) The NetWare BTrieve Engine, I have my doubts about it being the engine since we also have several OS/2 systems accessing the same data and never have a slow down or memory issue with them. My next experiment will be to load an old work station version of BTrieve that I still have laying around and run everything local. If anyone has any ideas or suggestions, I'm all ears. (I don't have much hair left). Lee Peedin |
#6
| |||
| |||
|
|
I have an issue with BTrieve (Pervasive 2000i) that I have narrowed down to either the BTrieve engine or the Win32 BTrieve client. A bit of history: Win2K system (Schedule system) Novell Server v6 Object Rexx programming language Schedule system runs a single program we'll call ProgramA. This program wakes up every 30 seconds to check the records in a BTrieve file to see if it has anything scheduled for the current day/time. If it does, it calls ProgramB. ProgramB will do extensive reading on multiple BTrieve files. What we are witnessing is that over a period of time, all ProgramB's called by ProgramA get slower and slower. This morning I used a utility to check the memory in use by the thread ProgramA was running in. It was in excess of 132MB. A simple close of the window ProgramA was running in and reopening the window resulted in a memory usage of 3.2 MB. Trust me, I have done extensive testing and everything points to BTrieve. I set up a test system and have been running the same ProgramB on it for several weeks. After assuring myself that I could recreate the problem, I began changing ProgramB trying to eliminate any possible causes of the memory leak. BTW: I copied my databases used in ProgramB to a seperate server folder so I would be testing on the same data on every run. Here's what I tried: 1) Removed all ActiveX components from ProgramB (this was primarily a component to print data to a PDF file). Still witnessed memory leak. 2) Removed all ::Requires statements from the code. A Requires statement in Object Rexx simply allows the program to access classes and methods in an external routine. Still witnessed memory leak 3) Exported all data from the BTrieve files into delimeted text files - modified program to read text files vs. BTrieve files - removed all BTrieve calls. Memory leak went away!! So, I said all that to say this. "Something" with BTrieve is causing the memory leak. It could be any one of the following: 1) The BTrieve API calls developed for Object Rexx, but in extensive conversation with the author of these API calls, he assures me that practically all memory usage is static with very little dynamic allocation. 2) The Win32 Btrieve client 3) The NetWare BTrieve Engine, I have my doubts about it being the engine since we also have several OS/2 systems accessing the same data and never have a slow down or memory issue with them. My next experiment will be to load an old work station version of BTrieve that I still have laying around and run everything local. If anyone has any ideas or suggestions, I'm all ears. (I don't have much hair left). Lee Peedin |
#7
| |||
| |||
|
|
OK -- this may sound like a silly question, but WHY were you trying to debug ProgramB when the memory for ProgramA seemed to be increasing? Could it not also be that the parent process has a problem in allocating memory and not freeing it up? Just a thought... BB Lee Peedin wrote: I have an issue with BTrieve (Pervasive 2000i) that I have narrowed down to either the BTrieve engine or the Win32 BTrieve client. A bit of history: Win2K system (Schedule system) Novell Server v6 Object Rexx programming language Schedule system runs a single program we'll call ProgramA. This program wakes up every 30 seconds to check the records in a BTrieve file to see if it has anything scheduled for the current day/time. If it does, it calls ProgramB. ProgramB will do extensive reading on multiple BTrieve files. What we are witnessing is that over a period of time, all ProgramB's called by ProgramA get slower and slower. This morning I used a utility to check the memory in use by the thread ProgramA was running in. It was in excess of 132MB. A simple close of the window ProgramA was running in and reopening the window resulted in a memory usage of 3.2 MB. Trust me, I have done extensive testing and everything points to BTrieve. I set up a test system and have been running the same ProgramB on it for several weeks. After assuring myself that I could recreate the problem, I began changing ProgramB trying to eliminate any possible causes of the memory leak. BTW: I copied my databases used in ProgramB to a seperate server folder so I would be testing on the same data on every run. Here's what I tried: 1) Removed all ActiveX components from ProgramB (this was primarily a component to print data to a PDF file). Still witnessed memory leak. 2) Removed all ::Requires statements from the code. A Requires statement in Object Rexx simply allows the program to access classes and methods in an external routine. Still witnessed memory leak 3) Exported all data from the BTrieve files into delimeted text files - modified program to read text files vs. BTrieve files - removed all BTrieve calls. Memory leak went away!! So, I said all that to say this. "Something" with BTrieve is causing the memory leak. It could be any one of the following: 1) The BTrieve API calls developed for Object Rexx, but in extensive conversation with the author of these API calls, he assures me that practically all memory usage is static with very little dynamic allocation. 2) The Win32 Btrieve client 3) The NetWare BTrieve Engine, I have my doubts about it being the engine since we also have several OS/2 systems accessing the same data and never have a slow down or memory issue with them. My next experiment will be to load an old work station version of BTrieve that I still have laying around and run everything local. If anyone has any ideas or suggestions, I'm all ears. (I don't have much hair left). Lee Peedin |
![]() |
| Thread Tools | |
| Display Modes | |
| |