我正在使用GATE nlp来解析文档。当一些带有加密文本的文档在管道中得到处理时,首先它将挂起应用程序一段时间后再抛出OutOfMemory异常。我还增加了服务器大小,但问题仍然存在(抛出时间间隔异常)。 我还在GATE文档中添加了以下内容:
Delivery to the following recipient failed permanently noreply invite.freelancer.com Technical details of permanent failure DNS Error Address resolution of invite.freelancer.com. failed DNS server returned answer with no data Original message X Google DKIM Signature v 1 a rsa sha256 c relaxed relaxed d 1e100.net s 20130820 h x gm message state to from date message id subject mime version content type content transfer encoding content disposition precedence auto submitted bh ZqQVC blyigSDolCexcBuA0XSkdadZbW1Lz203WjYh0 b CfgWFuF LrpKhBqdK1hC8PnmAWaZKItgYacEdn d5DM1zMJTy9ZeJqohr 7AFQAxZ6 Lo3TALSjPpWCcWc84fhbgPpvcD7Y69BDCVaACFB2ZzmQdr1irz6NNnueEb7w1qi7uSJE WkcngEigf2m 0tcEwImBqEP04XePEpEcqu RYVMH9btl2U 9BqkDwOELAtRTIJ0XagDW G7SskYC4WkuJ78ZbfE1QAPPvKC 30hCKKhJ6luMcZMo2KeVndhVFFGG fNw8jc2dJBMZ aPkMYJQuhTzmoBqFZm5nuye2aoALwmtQs5ruu0rN4NhQo4cFHHtSd37R3Smy kq4JdTp FEkw X Gm Message State ALoCoQn2hyCwZttbqWrKGcY7eFT folV18HO iA3QqGNI6QajO7jelDjfb0gK9C8eWA3rakzTYMZCSL2PEeBdC9mw4zL35er5a 8qKX3h Sota EsEQtDA8LjLmMj5rq0SaDqtR21ZPOh18LHiZ0q7f374ntefjZnPjY SJ wIdNddiZfZB0ANM4AwSYfBbJ5wDYNxtORqDX X Received by 10.112.142.232 with SMTP id rz8mr4452539lbb.74.1433949006695 Wed 10 Jun 2015 08 10 06 0700 PDT To noreply invite.freelancer.com From candidate abc Date Wed 10 Jun 2015 08 10 06 0700 Message ID Subject Auto Reply Re invites you to Freelancer MIME Version 1.0 Content Type text html charset UTF 8 Content Transfer Encoding base64 Content Disposition inline Precedence bulk X Autoreply yes Auto Submitted auto replied End of message
答案 0 :(得分:0)
如果要保留使用大部分内存的JSONObject。它可以是原始文件/输入字符串大小的许多倍。
如果要释放内存,请不要保留它。理想情况下,您应该使用SAX样式解析器并在读取时处理该文件,因此文件的大小无关紧要。
简而言之,只有在您需要时才保留对象,并且如果您确实准备好确保有足够的内存。