问题描述
我正在为分析问题编写数学模块。所有文件都编译为 .fasl。 这些文件的大小逐渐增加,并添加了新文件。我今天在加载一个模块 load("foo.mac") ~0.4s 加载 100+ 个文件和另一个来自 200+ 个的模块时遇到了一个问题,这些模块在没有预计算的情况下声明了函数和变量。
错误:Thread local storage exhausted Fatal error encountered is SBCL pid %PRIMITIVE HALT called; the party is over. Welcome to LDB..
cpu 和 RAM 指标目前稳定
没有帮助 maxima -X '--dynamic-space-size 2048'
,4096 - 默认情况下也是 1024。为什么它不起作用?
SBCL + Windows = 工作没有错误。 SBCL 1.4.5.debian + Linux(服务器)抛出这个错误。但是,如果我稍微减小文件的大小,则加载模块。
我重新编译了文件,检查了所有 .UNLISP。更改了上传文件的顺序,但加载列表中最近的时出错。测试运行没有错误。有一些方法可以通过 SBCL、Maxima 增加“本地存储”的数量? 往哪个方向移动?任何想法
更新: 通过删除重复代码 matchdeclare(..) 显着减少了负载。现在没有观察到错误。
解决方法
来自https://sourceforge.net/p/maxima/mailman/message/36659152/
maxima 使用了相当多的特殊变量,这有时会使 运行测试套件时,sbcl 耗尽了线程本地存储。 他们提议添加一个允许更改的环境变量 线程本地存储大小,但添加了命令行选项 相反 => 如果 sbcl 支持,我们现在生成一个图像 ab 更大的默认线程本地存储,其大小可以是 被传递 --tls-limit 选项的用户覆盖。
SBCL 源码中的 NEWS
文件也说明默认值为 4096
changes in sbcl-1.5.2 relative to sbcl-1.5.1:
* enhancement: RISC-V support with the generational garbage collector.
* enhancement: command-line option "--tls-limit" can be used to alter the
maximum number of thread-local symbols from its default of 4096.
* enhancement: better muffling of redefinition and lambda-list warnings
* platform support:
** OS X: use Grand Central Dispatch semaphores,rather than Mach semaphores
** Windows: remove non-functional definition of make-listener-thread
* new feature: decimal reader syntax for rationals,using the R exponent
marker and/or *READ-DEFAULT-FLOAT-FORMAT* of RATIONAL.
* optimization: various Unicode tables have been packed more efficiently