al compilar, miktex-dvipdfmx.exe ocupaba una memoria enorme (más de 10 GB) y nunca finalizaba

al compilar, miktex-dvipdfmx.exe ocupaba una memoria enorme (más de 10 GB) y nunca finalizaba
\documentclass[10pt,a4paper]{article}
\usepackage{fontspec}%setmainfont的依赖
\usepackage[hidelinks]{hyperref}%hidelinks属性隐藏了link的颜色
\usepackage{etoolbox}
\usepackage{ctex}
\usepackage{CJK}
\usepackage{geometry}
\usepackage{color}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\everymath{\displaystyle}%全局定义所有的inline元素按display元素展示
\setlength{\lineskiplimit}{10bp}%行间距界限
\setlength{\lineskip}{10bp}%触到界限重新设定行距
\setlength{\parindent}{2em}
\setmainfont{Times New Roman}
\geometry{a4paper,left=1cm,right=1cm,top=1cm,bottom=2cm,textwidth=1cm}
\color[rgb]{0.45,0.45,0.35}
\title{考研数学历年真题题库}
\author{十五}
%\csdef{Q1}{1.1.2-1992-2,3-1}  定义本质题号
%\csdef{Q1=}{$已知f(x)=e^{x^2},f[\varphi(x)]=1-x,\varphi(x) \geqslant 0,求\varphi(x)以及D(\varphi(x))$} 定义题目内容
%\csdef{A1}{}
\newcommand{\toA}[1]{\hyperlink{答案-#1}{答案}\hypertarget{问题-#1}{}}
\newcommand{\toQ}[1]{\hyperlink{问题-#1}{返回}\hypertarget{答案-#1}{}}
%定义超链接跳转,A是答案,Q是问题
\newcommand{\Qf}[3]{\paragraph{[#1]}#2\\#3\\}
\begin{document}    
\setcounter{tocdepth}{4}
\maketitle %显示标题
\large  
\boldmath
\tableofcontents%自动生成目录,根据section,subsection,subsubsection生成
\csdef{Q5}{1.1.1-1987-2-1}
\csdef{Q5=}{
    $\begin{aligned}
    &   f(x)=|x \sin x| \mathrm{e}^{\cos x}(-\infty<x<+\infty) 是()\\&
    (A)有界函数~(B)单调函数~(C)周期函数~(D)偶函数
    \end{aligned}$\\
}
\csdef{A5}{
    $\begin{aligned}
    解:\\&f(-x)=|-x \cos (x)| e^{\cos (-x)}=|x \cos x| e^{\cos x}=f(x) \Rightarrow D正确\\&\lim _{x \rightarrow \infty} f(x)=|x \cos x| e^{\cos x}>|x| \rightarrow+\infty \Rightarrow  A错误\\&f\left(\frac{\pi}{2}\right)=\frac{\pi}{2} \cdot e^{0}=f\left(-\frac{\pi}{2}\right)=\frac{\pi}{2} e^{0}, f(0)=0 \Rightarrow  不单调,B错误.\\&f(x+2 \pi)=|(x+2 \pi) \sin x| e^{\cos x} \neq|x \sin x| e^{\cos x}=f(x) \Rightarrow C错误
    \end{aligned}$
}
\newpage
\Qf{\csuse{Q5}}{\toQ{\csuse{Q5}}}{\csuse{Q5=}}\\
\newpage
\Qf{\csuse{Q5}}{\toQ{\csuse{Q5}}}{\csuse{Q5=}\\\csuse{A5}}\\

\end{document}

No sé cómo solucionarlo. compilar otro archivo tex está bien, solo este archivo tiene el problema.

actualizar:

si elimino el archivo \Qf{\csuse{Q5}}{\toQ{\csuse{Q5}}}{\csuse{Q5=}\\\csuse{A5}}\\ , se puede compilar, y si escribo dos oraciones iguales: \Qf{\csuse{Q5}}{\toQ{\csuse{Q5}}}{\csuse{Q5=}}\\ \Qf{\csuse{Q5}}{\toQ{\csuse{Q5}}}{\csuse{Q5=}}\\ todavía tiene el problema.

Respuesta1

No hay problema con el siguiente preámbulo y TeXLive2019 actualizado

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fontspec}%setmainfont的依赖
\usepackage{etoolbox}
\usepackage{ctex}
\usepackage{CJK}
\usepackage{geometry}
\usepackage{color}
\usepackage{setspace}
\everymath{\displaystyle}%全局定义所有的inline元素按display元素展示
\setlength{\lineskiplimit}{10bp}%行间距界限
\setlength{\lineskip}{10bp}%触到界限重新设定行距
\setlength{\parindent}{2em}
\setmainfont{Times New Roman}
\geometry{a4paper,left=1cm,right=1cm,top=1cm,bottom=2cm,textwidth=1cm}
\color[rgb]{0.45,0.45,0.35}
\usepackage[hidelinks]{hyperref}%hidelinks属性隐藏了link的颜色
\title{考研数学历年真题题库}
\author{十五}
%\csdef{Q1}{1.1.2-1992-2,3-1}  定义本质题号
%\csdef{Q1=}{$已知f(x)=e^{x^2},f[\varphi(x)]=1-x,\varphi(x) \geqslant 0,求\varphi(x)以及D(\varphi(x))$} 定义题目内容
%\csdef{A1}{}
\newcommand{\toA}[1]{\hyperlink{答案-#1}{答案}\hypertarget{问题-#1}{}}
\newcommand{\toQ}[1]{\hyperlink{问题-#1}{返回}\hypertarget{答案-#1}{}}
%定义超链接跳转,A是答案,Q是问题
\newcommand{\Qf}[3]{\paragraph{[#1]}#2\\#3\\}
\begin{document} 
[...]
\end{document}

ingrese la descripción de la imagen aquí

información relacionada