It works as it should when I recompiled with the exact replacement you
suggest. I had done it before I sent my e-mail, because I suspected it
was an overlook and was supposed to be be working actually. I have
noticed no adverse effects for now, and the memory leak is gone.
The use case is genetic programming, where we evolve thousands and tens
of thousands of candidate programs, and the only way to realistically
dispose of them after compilation and testing is to use marker around
the whole population. So each individual is compiled as a separate
no-name definition, and in the end, after being tested and evaluated, it
needs to be destroyed to repeat the process with the next generation.
And this was the only practical way I found of doing it reasonably
quickly: creating a marker before compilation and then using it to
dispose of the population. And so this is what happens when you do it
repeatedly, like tens of thousands of individuals over tens of thousands
of generations. This adds to many millions of programs. And memory
exhaustion happens quite quickly in that case.
The results are spectacular,the GP system is about 2x to 3x faster in
1.0.1. than in 0.7.3., depending on problem.
Another thing I noticed - why did you change the warnings to warn that
e.g. 1. or 0.0 are double cell integers? This is standard, there is no
need to warn about standard behavior, I think.
Greetings,
Elko
On 11/5/26 14:19, Anton Ertl wrote:
On Thu, Nov 05, 2026 at 01:15:05PM +0200, Elko Tchernev wrote:
However, Marker does not release the memory and does not restore code_here.
It is foreseen in the code, line 94 of marker.fs
cell+ [IFDEF] forget-dyncode dup forget-dyncode3 drop [then]
But since forget-dyncode is undefined, it does not do it, which leads to a
memory leak, especially when you compile and forget millions of definitions.
Is the current setting on purpose, or a bug?
Looks like a bug to me. This should read
cell+ [IFDEF] forget-dyncode3 dup forget-dyncode3 drop [then]
However, it seems that forget-dyncode3 was never tested. Since you
are apparently a serious user of MARKER, could you try it and report
if it works as it should, as far as you can say.
We did not find this kind of bug earlier because we do not use MARKER
ourselves. My impression has been that MARKER requires much more
implementation effort than is justified by the tiny benefit it gives.
Maybe you could elaborate on your use of marker to raise our awareness
of the benefits of using MARKER.
- anton