On Fri, Sep 5, 2025 at 5:52 AM Ivan Krylov <[email protected]> wrote:

> В Thu, 4 Sep 2025 17:16:15 -0400
> Steve Rowley via R-help <[email protected]> пишет:
>
> > Then I use erase.screen() to erase the previous
> > image, use plot() to set up a plotting area, and display the image
> > with rasterImage().
>
> erase.screen() works by drawing a background-coloured rectangle over
> the plot, so the previous images remain in the display list despite
> being completely over-painted:
>

Thank you very much!

This was indeed the issue.  Like most bugs, it is in retrospect obvious,
but as Kierkegaard (approximately) said, we don't live in retrospect. :-)

I used dev.control(displaylist = "inhibit") on the screens created by
split.screen().  This leads to some redisplay problems if the window is
resized, but other than that everything seems to work and I'm happy to live
with that little problem.  (Possibly MacOS is doing some redisplay work
here in the background.)

Reporting memory size after each iteration shows it operates in
approximately constant memory now.  ("Approximately" means that it does
expand a bit for larger images, but GC works to retrieve the memory, so
that's ok.)

Thanks to all who offered an opinion.  (Or even thought about it, that sort
of kindness counts too!).

And especial thanks to Ivan for nailing the problem exactly, just from my
vague description.  I'm really, really impressed with your debugging
prowess.
___________
Steve Rowley <[email protected]> Zoom: 839 529 4589
<https://us04web.zoom.us/j/8395294589?pwd=dlQ4MUFHK1NFOCtoZFpUNFRtZ2lSQT09>
It is very dark & after 2000.  If you continue, you are likely to be eaten
by a bleen.

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to