sampleImage() uses a lot of RAM, especially when using a large radius, to the point of wildly exceeding "allowed" RAM usage. However, the only way to "reset" this high usage is to restart the program, simply closing the project leaves the usage high. Lowering the sample radius will temper usage.
Could you share your system specifications? Also, a sample image that repeats the issue? Have you tried purging the memory (Edit > Purge > All Memory & Disk Cache)?
Let us know if that helps.
Moving the thread from Bugs to Discussions for troubleshooting.