MikTex 内存不足

MikTex 内存不足

我正在尝试使用 tikz 构建一些图形...但有一个图形一直构建失败,并且日志文件表明我的内存不足。

我用过

initexmf --edit-config-file pdflatex
initexmf --dump=pdflatex

为了将可用内存增加到我认为可以的程度...配置文件现在读取

pool_size=40000000 
main_memory=50000000 
extra_mem_bot=40000000

但日志文件告诉我

43000001 words of memory out of 43000000

令人沮丧的是,我以前在一台内存较小的旧电脑上构建过这个图形...它是剪切和粘贴代码......这让我想到也许我搞砸了一些东西,让一些东西失控了。

这是该图的代码

%%%%%%%%%%%%%%%%%%%%%%
\documentclass{singlecol-new}
%%%%%%%%%%%%%%%%%%%%%%

\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\usetikzlibrary{pgfplots.groupplots}
\usetikzlibrary{plotmarks}
\usetikzlibrary{patterns}
\usetikzlibrary{calc}
\usepgfplotslibrary{external}

\usepackage[external]{tcolorbox}
\tcbset{
    external/prefix=\jobname-,
    external/safety=0mm,
    external/input source on error=false,
    }

\pgfplotsset{compat = 1.12}

\tcbEXTERNALIZE
\tikzexternalize



%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%


\begin{figure}[h!]
    \centering
    \begin{extikzpicture}[runs=2]{fig7}
        \begin{axis}[
                height=8cm,
                width=8cm,
                xmin=0,
                xmax=10000,
                %legend style={draw=none},
                legend style={at={(0.9,0.4)}},
                xlabel = $\frac{V(A)}{Resource Cost}$ Ratio,
                ylabel = P(X),
                width=0.75\textwidth,
                y tick label style={
        /pgf/number format/.cd,
            fixed,
            fixed zerofill,
            precision=1,
        /tikz/.cd
    },
    x tick label style={
         /pgf/number format/.cd,
            fixed,
            fixed zerofill,
            precision=0,
        /tikz/.cd
    },
        scaled ticks=false,
        ]
            \addplot+[black, mark=o,line join=round, mark repeat=1000] table[col sep=comma, y=Empirical, x=X]{CDFs.csv};
            \addlegendentry{{\scriptsize Empirical Data}}
            \addplot+[black, mark=x,line join=round, mark repeat=1000] table[col sep=comma, y=PT, x=X]{CDFs.csv};
            \addlegendentry{{\scriptsize Extended Pearson-Tukey}}
            \addplot+[black, mark=|,line join=round, mark repeat=1000] table[col sep=comma, y=SM, x=X]{CDFs.csv};
            \addlegendentry{{\scriptsize Extended Swanson-Megill}}
            \addplot+[black, mark=square,line join=round, mark repeat=1000] table[col sep=comma, y=BM, x=X]{CDFs.csv};
            \addlegendentry{{\scriptsize Bracket Median}}
        \end{axis}
    \end{extikzpicture}
    \caption{Elicited CDFs}
    \label{CDFGraph}
\end{figure}

\end{document}

显然,数据在这里很重要,但我不确定如何包含它。它由 10,002 行乘以 5 列浮点数组成,以形成 4 个线图……老实说,这是本文中最简单的图表之一……

数据文件看起来像

X   Empirical   PT  BM  SM
0   0   0.001   0.001   0.001
1   0   0.001   0.001   0.001
2   0   0.001   0.001   0.001
3   0   0.001   0.001   0.001
4   0   0.001   0.001   0.001
5   0   0.001   0.001   0.001
6   0   0.001   0.001   0.001
7   0   0.001   0.001   0.001
8   0   0.001   0.001   0.001
9   0   0.00101 0.001   0.001
10  0   0.00101 0.001   0.001
11  0   0.00101 0.001   0.001
12  0   0.00101 0.00101 0.00101

....
9990    1   1   1   1
9991    1   1   1   1
9992    1   1   1   1
9993    1   1   1   1
9994    1   1   1   1
9995    1   1   1   1
9996    1   1   1   1
9997    1   1   1   1
9998    1   1   1   1
9999    1   1   1   1
10000   1   1   1   1

答案1

需要在 MiKTeX 中增加内存

我四处搜索并收集了以下建议,这使我能够重新访问并运行这个情节。

 > initexmf --edit-config-file=pdfLaTeX

在记事本中更改或如果没有先前的值,请添加以下行

main_memory=12000000
extra_mem_bot=99999999
font_mem_size=3000000

保存文件并返回提示运行

> initexmf --dump=pdflatex

如果收到错误消息,则需要重复并减少值,直到 --dump=pdflatex 不出错(为了提高速度,使用“二进制砍伐”,最后一半的差异)

之前,25% 的点需要
2008247 个字的内存,而 3000000 个字(默认)的点需要
2938707 个字的内存,而 45% 的点需要 3000000 个字(默认)的点需要

然而,最终的工作日志显示,对于全部 10000 个点,
  内存中有 100% 是 793011 个字
,而内存总数为 12000000 个字,约占预期的 10%!(猜测它在运行时会被部分清除)

答案2

有趣的是,我卸载并重新安装了 pgf 包,这个问题就消失了。不确定这算不算“答案”……

相关内容