![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Memory Leak Topic Summary: Created On: 21-Apr-2003 18:58 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I have some real complicated and involved DXL and am experiencing SEVERE "memory leak" problems, as reported by "Task Manager" and verified with testing: the longer they run the slower they run.
I have NOT had luck using Buffers instead of string catenation, although I HAVE had luck changing the way I catenate strings, I concatenate them in a simple function. Anybody has some details on the real problem and some ways I can reduce or elliminate the problem? - Louie |
|
![]() |
|
![]() |
|
I had problems in the past, where the memory usage increased and performance degraded every time I called a aprticular eevnt. It was because I was not deleting a certain array which I created each time the event occured.
The 'creates' and 'deletes' should ideally be matched. As for concatenation, when I have used strings instead of buffers, the performance degradation has not been significant. Hope that helps. ------------------------- Nandan Banodkar (nandanbanodkar@hotmail.com) |
|
![]() |
|
![]() |
|
One thing to consider when running DXL scripts.
When you create a buffer or skip list, if you do not delete, purge or resize the buffer or skip list the memory used by DOORS will remain allocated to DOORS, however when you are finished using a buffer or skip list you should delete it or resize it. Regards, Vince |
|
![]() |
|
![]() |
|
Hi Louie,
"the longer they run the slower they run" was it related with rich text processing? I face also similar situation. For example, I have a module with 500 objects and then I am opening the same module 10 times from a loop and processing the object. I have observed the time taken by each iteration and the result is first one took near about 3 mins where the 10th one took 20mins (same module, same job!). Could you please tell us: 1. what was your situation for "the longer they run the slower they run" (I hope you can remember although you faced it couple of years back ;-)? 2. how did you solve that problem? 3. any recommendation to avoid "the longer they run the slower they run" problem? Thanks for the further assistance. Rony |
|
![]() |
|
![]() |
|
As another aside to this strand, I am considering running some doors tasks overnight using windows scheduler, and I know for sure I will run into the old string table memory leak problem.
Whenever I run a script using windows scheduler, I come back the next moring to find that DOORS is still up and running in the task manager, and of course the memory has not been de-allocated.
Does anyone know how to 'kill' the DOORS task using the windows scheduler. That way I could at least overestimate the time required and kill off the DOORS process, then fire it up again for the next slice of processing.
Thanks
Andrew.
------------------------- Andrew Tagg Thales Air Systems, Melbourne Australia. andrew.tagg@thalesatm.com |
|
![]() |
|
![]() |
|
If you are creating buffers inside of functions, this could slow the performance. Try using a global buffer and reuse it:
Buffer gBufTmp = create() void fn1(){ gBufTmp = "stuff" gBufTmp += " More Stuff" } void fn2(){ gBufTmp = "" bGufTmp = "Do Other Stuff" } void fnClean(){ delete(gBufTmp) gBufTmp = null } fn1 fn2 fnClean ------------------------- Bruce Tuskey Sr. Principle Engineer Tuskey@gmail.com "All that is gold does not glitter, not all those who wander are lost:..." - Gandalf the Grey (JRR Tolkien) |
|
![]() |
|
![]() |
|
Yes, I've got lots of library functions that use a local buffer to calculate a result, which is passed back as a string. I routinely assigne each function a 'global' buffer which only it uses, its created once outside the function. In the function I assign the buffer to "" where I would normally be creating the buffer. Yes, these buffers are never deleted but I'm sure that matters very little. ... in fact it matters only as much as the largest the buffer has ever been, which is a sub-linear increase based on useage which is no big deal.
Yes, this theoretically conflicts with nebulous 'best practices' theory of writing functions. To get around that, I put the name of the function into the name of the buffer and give it a special prefix, to insure nobody else uses the buffer, accidentally or otherwise. I've got a couple functions (pattern searches) that perhaps get called 300,000 times per big script, and that's a bunch of time saved creating buffers. But this only saves time in creating and deleting buffers, it speciically does NOT save exponential time in memory leak issues. It therefore does not reduce the 'longer it runs the slower it runs' problem, it just makes it run faster. - Louie |
|
![]() |
|
![]() |
|
Nice tip. Thanks, will give this one a try tomorrow.
------------------------- Andrew Tagg Thales Air Systems, Melbourne Australia. andrew.tagg@thalesatm.com |
|
![]() |
|
![]() |
|
Hi Louie,
Could you please share your thought regarding the following questions? Thanks a lot... :-) 1. what was the reason for "the longer they run the slower they run" problem (I hope you can remember although you faced it couple of years back ;-)? 2. how did you solve that problem? 3. any recommendation to avoid "the longer they run the slower they run" problem? Greetings, Rony |
|
![]() |
|
![]() |
|
A little bird mentioned to me that there is a tempStringOf_ DXL perm that may come in handy, I haven't had the chance to test, but I'm told the temporary string doesn't get added to the string table.......
------------------------- Graham Stradling, Alcatel-Lucent. |
|
![]() |
|
![]() |
|
tempStringOf(Buffer) retrieves the string in some sort of 'temporary' fashion without wasting more space in the string table. Do not use this perm to assign to a variable since the varioble's value MAY accidentally change when you subsequently change the buffer.
The following code shows the problem: Buffer buf = create() buf = "abcdef" string Temp = tempStringOf(buf) print "1 Temp = " Temp "\n" buf = "123" print "2 Temp = " Temp "\n" delete(buf) Notice that the value of Temp changes when you modify buf. You can use this perm to print the contents of a Buffer, assign it to an attribute value, or to send it to a file. - Louie |
|
![]() |
|
![]() |
|
tempStringOf(Buffer) assigns the pointer to the buffer to the string pointer...thus why changing the contents of the buffer will seem to change the contents of the string.
|
|
![]() |
|
![]() |
|
quote:In my experience I have found that passing a string into or returning a string value from a function also causes my DXL to run slowly. Using a buffer instead speeds up execution time considerably. Instead of string trimSpaces(string inputValue), I will use a structure similar to void trimSpaces(Buffer buf) where the contents of buf is set to the string I want to perform the operation on. Any changes to that buffer inside the function persist when the function terminates. -Dennis |
|
![]() |
|
![]() |
|
That's because you would be passing the string "by value" not "by reference" and the buffer gets passed by reference...
if your function would be trimSpaces(string &inputvalue) it would perform as fast as the buffer because they are both passing in pointers. |
|
![]() |
|
![]() |
|
quote: I think my questions are got buried under other replies :-(... Thank you all... Rony |
|
![]() |
|
![]() |
|
But if you do the assignment using a string handling perm then it assigns a string
so Buffer buf = create() buf="abcd" string Temp ="xyz" Temp = richText tempStringOf(buf) print "1) "Temp "\n" buf = "123" delete(buf) print "2) "Temp"\n" will print 1) abcd 2) abcd meaning you can do all those string concatenations in the buffer then assign to a string, keeping the string table cleaner. That said, it won't buy you much compared to just concatenating the buffer with "" but from the way I understand it does help in very iterative code. ------------------------- Graham Stradling, Alcatel-Lucent. Edited: 19-Oct-2006 at 11:50 by Graham Stradling |
|
![]() |
|
![]() |
|
Your use of the richText command converts the buffer contents into a new string which does take up string table space. Since the buffer contains no rich text I don't see any difference between your 'richText tempStringOf(buf)' any different than 'stringOf(buf)', other than whatever extra overhead there is associated with the richText command.
- Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Memory Leak
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.