Here is my code <mail mailhost="..." mailport="25" from=".@." tolist=".@." subject="Message" messagefile="message.html" encoding="mime" messagemimetype="text/html" charset="Windows-1251">
Hi, Peter Chase. All string have the same size excepts the last. We have assistant class for sending big UTF String and for receive them. This class splits big string to blocks, then write blocks amount, and then write parted strings.
In some cases this code throws OutOfMemoryError. As I understand, it happens because StringBuffer cannot allocate enough memory space. When in JVM I pass the parameter -Xmx256M, then I don't have this problems.
This kind of code doesn't make the same problem
As far as I know, String always reallocate memory when I work with it. And this influence on execution time. I don't want to set -Xmx to JVM. Where is the dog buried and how to resolve this question by another road?