java outOfMemoryError with stringbuilder

前端 未结 6 750
囚心锁ツ
囚心锁ツ 2020-12-15 12:44

I\'m getting a java outOfMemoryError when I call this method - i\'m using it in a loop to parse many large files in sequence. my guess is that result.toString()

6条回答
  •  无人及你
    2020-12-15 12:57

    Yes! Don't buffer in memory otherwise you'll run out of it specially if you're going over 2MB on I/O.

    Recommended link for fixing and appending text: http://java.ittoolbox.com/documents/appending-data-to-a-file-18786

提交回复
热议问题