Skip to content

Scheme Memory management - resolution of "out of heap space" and "free store overflow" errors

Question

When running long scheme macros, I get the error message "out of heap space" or "free store overflow" in the Message/Macro window, and the macro fails to run to completion." How can I resolve this?

Synopsis

Scheme Memory management - resolution of "out of heap space" and "free store overflow" errors

Symptoms

TracePro has a separate "memory cache" dedicated to running Scheme macros, and the size of this cache is fixed. The consumption of this memory is cumulative, so when running a particularly long macro, or even running a shorter macro multiple times in a TracePro session, the memory cache can be filled, resulting in an error message or sometimes a program crash.

Workaround

1) One workaround to this problem, at least for multiple runs of shorter macros, is to quit and relaunch TracePro to free up the Scheme memory cache. 2) A report from one customer indicates that inserting the (collect) command into the loop in his macro enabled the macro to run to completion.

Solution

The long-term resolution is to improve the memory management so that Scheme memory is freed up continuously. Incremental improvements have been made to TracePro to reduce the severity of the problem: TracePro 3.3.5 - increased the size of the scheme memory cache. This reduced the frequency of occurrence of the problem but did not eliminate it completely because the root cause of the problem, that the memory consumption is cumulative, was not yet resolved. The following macro, which simply counts from 1 to 100,000 and displays the value, was used to test the cumulative memory consumption: (define xStart 0 ) (define xFinish 100000 ) (define xIncrement 1 ) (do ( (xValue xStart (+ xValue xIncrement ) ) ) ( (> xValue xFinish ) xValue ) ;; X iteration (display (string->symbol (string-append "X = " (number->string xValue) ) ) ) (newline) ) ;; X iteration In TracePro 4.0.3, this macro could be run successfully 3 times but would fail to complete the 4th iteration. In TracePro 4.1, the macro completes 8 iterations successfully (we did not test it to failure). We do not believe that the problem is 100% resolved, but the improvements made for TracePro 4.1 may have moved the memory consumption threshold enough so that this problem no longer occurs. If you encounter a set of circumstances running repetitive macros that cause TracePro to crash or produce an "out of heap space" error, please notify us at support@lambdares.com and we will continue the incremental improvement of TracePro's Scheme Memory management using that test case as the new benchmark.