dear all
I had a problem, the following code in the execution 1-190 times to do not have a problem, but in between 190-210 will always be the error, can you tell me how to solve? The following is my code.
the exception in unoidl.com.sun.star.uno.XComponentContext xLocalContext = uno.util.Bootstrap.bootstrap();this line .
Please tell me how to solve this~
3Q
RoryOF wrote:Consider a memory leak, where shortage of memory reaches critical proportions after 190+ iterations of your code.
how to do this? Thread.Sleep(1000);?
but when i restart the application the bootstrap is ok~
if the code in a service, the service cannot restart.
can u give me a sample for Csharp to generate pdf more then 200 times and no exception?
RoryOF wrote:Consider a memory leak, where shortage of memory reaches critical proportions after 190+ iterations of your code.
how to do this? Thread.Sleep(1000);?
but when i restart the application the bootstrap is ok~
if the code in a service, the service cannot restart.
can u give me a sample for Csharp to generate pdf more then 200 times and no exception?
You need to monitor memory usage using some form of monitoring utility. If you are writing low level code you should find out about debugging.
With regard to your email to me, on the Forum we deal with all applications through publicly posted messages and replies, not off-channel.
No, I cannot give an example of Csharp code to do what you request, as I do not program at that level, but my instinct is that the first culprit for your code to fail after so many iterations is most likely a memory leak. How you follow this suggestion is for you to decide.
RoryOF wrote:Consider a memory leak, where shortage of memory reaches critical proportions after 190+ iterations of your code.
how to do this? Thread.Sleep(1000);?
but when i restart the application the bootstrap is ok~
if the code in a service, the service cannot restart.
can u give me a sample for Csharp to generate pdf more then 200 times and no exception?
You need to monitor memory usage using some form of monitoring utility. If you are writing low level code you should find out about debugging.
With regard to your email to me, on the Forum we deal with all applications through publicly posted messages and replies, not off-channel.
No, I cannot give an example of Csharp code to do what you request, as I do not program at that level, but my instinct is that the first culprit for your code to fail after so many iterations is most likely a memory leak. How you follow this suggestion is for you to decide.
how to monitor memory? which the object i should monitor it?
Turn on TaskManager (Ctrl shft ESC); this is a built-in monitor for processes and will do to start with. Thre are more specialised tools which Google will find, but start with this one. On its Processes tab you will see the memory consumed by each running process.
RoryOF wrote:Turn on TaskManager (Ctrl shft ESC); this is a built-in monitor for processes and will do to start with. Thre are more specialised tools which Google will find, but start with this one. On its Processes tab you will see the memory consumed by each running process.
sorry i means that which object in ooo if i monitoring it can let me resolved this bug?
In TaskMaster observe the memory in use by soffice processes; this may increase for each iteration of your code until the code fails. If so you have to determine why; perhaps this might be due to an internal flaw in OpenOffice (the mempry leak I referred to), for which there might not be a fix other than restarting your code after a safe number of iterations, or due to a flaw caused by failure of your code to release its housekeeping spaces, which might require insertion of housekeeping events in your code sequence ("garbage collection") - see this reference for some hints http://stackoverflow.com/questions/2764 ... et-c-sharp
RoryOF wrote:In TaskMaster observe the memory in use by soffice processes; this may increase for each iteration of your code until the code fails. If so you have to determine why; perhaps this might be due to an internal flaw in OpenOffice (the mempry leak I referred to), for which there might not be a fix other than restarting your code after a safe number of iterations, or due to a flaw caused by failure of your code to release its housekeeping spaces, which might require insertion of housekeeping events in your code sequence ("garbage collection") - see this reference for some hints http://stackoverflow.com/questions/2764 ... et-c-sharp
i have used the using grammar, but the vs 2010 tip me:"the unoidl.com.sun.star.uno.XComponentContext do not support the interface of IDispose" ~
RoryOF wrote:In TaskMaster observe the memory in use by soffice processes; this may increase for each iteration of your code until the code fails. If so you have to determine why; perhaps this might be due to an internal flaw in OpenOffice (the mempry leak I referred to), for which there might not be a fix other than restarting your code after a safe number of iterations, or due to a flaw caused by failure of your code to release its housekeeping spaces, which might require insertion of housekeeping events in your code sequence ("garbage collection") - see this reference for some hints http://stackoverflow.com/questions/2764 ... et-c-sharp
I want to say, every time I open the soffice exe. This program after conversion, there are timely turn it off, but in the bootstrap to 200th time will still error, excuse me this problem have others reaction? If the openoffice open issued?