go stack/delete stack eats up memory in repeat loop
BNig
niggemann at uni-wh.de
Thu Jun 5 16:15:13 EDT 2008
Hi list,
I would like some opinions on the following
while evalutating a couple of thousand stacks of scientific data
retrospectively I discovered that repeatedly opening a stack with go stack
aStack and doing some things and then deleting stack aStack in one handler
eats up memory to the degree that Rev uses all the available RAM then some
virtual memory and then crashes.
This is on a MacBook Pro 2 GB RAM, MacOSX 10.5.2, 10.5.3, Revolution Studio
2.9
choose any stack of about 250 KB or greater and use activity monitor to see
the memory usage
It uses about 1 GB physical RAM for 200 to 300 repeats
on mouseUp
answer file "please choose a revolution stack to test for memory usage"
if it is empty then exit mouseUp
put it into theFile
repeat with i = 1 to 700
go invisible stack theFile
delete stack theFile
-- with or without wait there is a memory buildup
wait 5 millisecs with messages
put i
end repeat
end mouseUp
The good thing is there is a workaround at least under 2.9 with the send
command (not working for Media 2.7.4, still eating memory)
local theFile, theCounter
on mouseUp pMouseBtnNo
answer file "please choose a revolution stack to test for memory usage"
if it is empty then exit mouseUp
put it into theFile
put 0 into theCounter
send "goThatFile" to me in 10 millisecs
end mouseUp
on goThatFile
add 1 to theCounter
go invisible stack theFile
delete stack theFile
put theCounter
if theCounter < 1000 then send "goThatFile" to me in 5 millisecs
end goThatFile
So the question is whether one should consider it a bug or whether it is
what you expect since it is a "blocking" handler.
It is probably not a situation that occurs very often, but my feeling is
that, well, Revolution should not crash when it runs out of memory.
Anybody cares to comment on this?
best regards
Bernd Niggemann
--
View this message in context: http://www.nabble.com/go-stack-delete-stack-eats-up-memory-in-repeat-loop-tp17678623p17678623.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list