![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Skip list of buffers Topic Summary: Created On: 6-Aug-2007 13:26 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi all,
is it possible to create a skip list with keys being integers and values being buffers? I tried the attached code snippet, but as a result only got "worlworld", i.e. the last buffer put into the skip list. I guess it has to do with how buffers are stored in memory, but any clarification would be appreciated. Regards, Peter |
|
![]() |
|
![]() |
|
Hi Peter,
Buffers are handled like pointers, so you need to create separately each Buffer you want to place in a Skip list. In your example you stored two times the same Buffer in the Skip, so it will show the same value, if you modify one of them ![]() Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Hi Reik,
all right, thanks for the explanation. The dummy examples works properly when modified as you suggested. Just a side note in case someone else is going this way: You should not delete the Buffers after putting them into the Skip lists! If so, the loop creates just garbage result. Cheers, Peter |
|
![]() |
|
![]() |
|
Well at the end of your program, I'd delete them. You could still get a handle to them one at a time through their keys and delete them that way. Then delete the Skip List itself. Just have a variable keep track of how many buffers are in the skip list.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com Edited: 6-Aug-2007 at 18:14 by David Pechacek |
|
![]() |
|
![]() |
|
You cannot just delete them straight forwardly?:
for buf in skp do {delete(buf)} delete skp |
|
![]() |
|
![]() |
|
I experimented a bit and found the following strange behaviour:
a) yes, you can delete the Buffer values straightforward, as Louie suggests, but it has b) (sometimes) no impact on the memory consumption. However c) failing to delete the Buffer elements drastically increases the time required to delete the Skip list itself! The attached script repeatedly creates a skip list, fills it with Buffer values and deletes the skip list. The latter action is once done with deleting the individual buffer values, and once not. When I start a fresh DOORS session while constantly observing the Windows Task Manager, DOORS starts off with ~ 43K. Running the script in the DXL window produces the following output: 200 loops, 100 elements: With deletions of Buffers: 0 seconds Without deletions of Buffers: 21 seconds While the memory consumption in the Task Manager did not change. Thus, no leak, whether with or without deleting the Buffers. But without deleting the individual Buffers, the script runs orders of magnitude slower! No the weird thing: While I was testing this, now and then the DOORS memory consumption in the Task Manager dropped down to around 2K, and after that, not deleting the individual Buffers did actually increase memory consumption, thus a memory leak occured. It happened several times, but I was not yet able to reproduce this behaviour. And I have no idea whatsoever what might cause this. Ergo, I would strongly recommend to delete the Buffers before deleting the Skip list, as it anyway reduces program running time and might prevent memory leaks. Cheers, Peter |
|
![]() |
|
![]() |
|
I've seen [c] before. Very important that we know it. Makes me wonder what happens when the Skip you delete contains non-buffer things, like strings...
I've also seen the inexplicable drop in memory useage by DOORS a few years ago. IIRC I was demonstrating memory loss in some buffer command. I demonstrated that it occurs fairly randomly and not as a direct consequence of a sequence of DXL calls. IIRC, it occurs ONCE per script. Back then I contacted support under the impression there existed some sort of 'clean up leaked memory' function and hoping to get it, the response I got was that the developers were stumped at that behavior. Sure looks like there is some sort of memory reclamation, perhaps we should ask them again about it. - Louie |
|
![]() |
|
![]() |
|
As for [c] above: When experimenting on this, I did not see anything like that when the Skip contained strings. I did not bother deleting the elements one by one, as the deletion of the Skip list always happened instantly, regardless of the number of elements.
However, the situation is again different for the more obscure things like DxlObjects: Here, not deleting the elements has no impact on the time required for the deletion of the Skip list; however, it _does_ create a huge memory leakage. Therefore here, for different reasons, one should also delete the elements prior to the Skip list. As for the memory usage, what strikes me is that the drop is that deep. Fresh from the start, with no DXL run so far, no Module opened, DOORS is at > 40K. Just the main explorer window. Then, after the drop, it is around 2K, and I wonder what is possibly missing now. Or, if it is really leaked memory, it must be in the explorer window code itself (which is written in DXL, is it not?). And, also strange, after the drop the Buffer skip elements leaked memory, while before they didn't. So something quite general changed in the way the DXL code is interpreted. Unfortunately I am still on DOORS v7.0, so there is no point in asking Telelogic, but once we upgraded to a more decent version, I'll wait and see if I still see the memory drop. Peter |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Skip list of buffers
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.