Another view recycling problem with images
[1/13] from: roland::hadinger::arcor::de at: 14-Jun-2003 16:25
I just discovered the life2d.r demo has a problem with the garbage
collector, too.
Hard to explain, so here is a smaller version of the problem and
my preliminary workaround:
REBOL []
;; (tested with REBOL/view 1.2.1 and 1.2.8 on Windows XP Pro).
f1: make face [size: 1x1 edge: none]
f2: make face [size: 1x1 edge: none]
view layout [
box 50x50 rate 1 feel [
engage: func [f a e] [
if a = 'time [
loop 1000 [
f2/image: to-image f1
f1/image: to-image f2
]
loop 1000 [recycle] ; argh !!!!!!!!!!!!
]
]
]
]
The code above runs without crashing.
Now, in the line that is commented with the genuine rendition of
the scream that could be heard throughout my house (the "argh" :),
decrease the loop count to 1 (or even 0) and run the script again.
Much faster now! But after some time, the operating system will
run out of memory and crash.
This line is the workaround, but I don't quite understand it :)
Could anyone explain what I'm missing here?
--
Roland
[2/13] from: roland:hadinger:arcor at: 14-Jun-2003 16:51
Ah, sorry, I've been totally wrong. This has nothing to do
with the garbage collector, it is probably a memory leak...
loop 1000 [recycle]
just is so slow on my system that the
leak is less noticeable.
--
Roland
[3/13] from: roland:hadinger:arcor at: 14-Jun-2003 16:54
Ah, sorry, I've been totally wrong. This has nothing to do
with the garbage collector...
loop 1000 [recycle]
just is so slow on my system that the
memory consumption is less noticeable, but it's still there.
--
Roland
[4/13] from: greggirwin:mindspring at: 14-Jun-2003 11:06
Hi Roland,
I'm not sure what you're missing. I'd submit it to feedback perhaps.
While system/stats in REBOL will go up and down, Task Manager (W2K
here) shows memory use continually increasing. I played with a few
ideas but didn't hit on an answer.
-- Gregg
[5/13] from: rotenca:telvia:it at: 14-Jun-2003 22:42
i have any problem with this code under W98 View 1.2.8, both with recycle or
without
memory usage does not grows
no crash
it does not seem that new system memory is allocated
it is all ok for me
---
Ciao
Romano
[6/13] from: rotenca:telvia:it at: 14-Jun-2003 23:27
Hi Gregg,
Now I have done new tests (with a apparently better task manager) and really
seems that memory usage increase very slowly.
---
Ciao
Romano
[7/13] from: roland:hadinger:arcor at: 15-Jun-2003 19:46
I submitted this to feedback. Running these two lines:
f: make face [size: 1x1 edge: none]
i: to image! f
seems to cause the memory leak, which is not Windows specific.
[8/13] from: rotenca:telvia:it at: 16-Jun-2003 1:58
I can confirm under w98.
---
Ciao
Romano
[9/13] from: antonr:iinet:au at: 16-Jun-2003 19:14
Yes, on winXP too.
-Anton.
[10/13] from: maximo:meteorstudios at: 16-Jun-2003 10:14
I can confirm but might add that extra leakage is only added every 29th iteration of
that call !!!
don't ask how I figured that out. ;-)
if you call a few times, only the first iteration will actually leak memory. But if
you call another 29 times, you will get a new memory leak (both in system/stats) and
in windows task manager. I am running win NT4.0
-max
-----------
meteor Studios, T.D.
-----------
Strong enough for a man, but made for a woman
[11/13] from: maximo:meteorstudios at: 16-Jun-2003 9:49
Hi all,
on another note...
can anyone explain to me how it is that when you iconify a view app, windows memory manager,
tells you it goes back a very low amount of ram, but when you pop it back up, it goes
back to its (traditionaly) insane memory consumption?
like from 30MB down to 3MB and then back up to 30MB..
does view effectively release all of its view stuff or is this just another illustration
of the stupiditiy of the windows task manager memory count? (under win2k)...
-max
-----------
meteor Studios, T.D.
-----------
Strong enough for a man, but made for a woman
[12/13] from: greggirwin:mindspring at: 16-Jun-2003 10:27
Hi Maxim,
MOA> can anyone explain to me how it is that when you iconify a view app,
MOA> windows memory manager, tells you it goes back a very low amount of
MOA> ram, but when you pop it back up, it goes back to its
MOA> (traditionaly) insane memory consumption?
Only RT could say exactly what they're doing under the hood. I don't
think any of the system/stats refinements deal specifically with View
stuff, but someone else might know. I did see something odd here
though:
>> system/stats/types
Stats: improper block termination: #813FA0
Stats: improper block termination: #813FB0
Stats: improper block termination: #813FC0
Stats: improper block termination: #813FE0
Stats: improper block termination: #814060
== [end! 68 unset! 4478 error! 2 datatype! 1463 context! 0 native! 134 action! 121 routine!
0
op! 17 function! 807 object! 832 stru...
I'll send it to feedback.
-- Gregg
[13/13] from: greggirwin:mindspring at: 16-Jun-2003 11:05
Note to self,
>>> system/stats/types
GI> Stats: improper block termination: #813FA0
...
This goes back to at least 1.2.1 apparently.
-- Gregg