dda...@gmail.com
unread,Feb 4, 2013, 3:40:49 AM2/4/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to diff-mat...@googlegroups.com
Hi Neil,
I am using your DMP - Java code for a multi-threaded application which stores versions of files (essentially patches). The problem I am facing is with memory usage. Going through the code I see a lot of "new String()" and "String.substring()" usage which ends up being immutable and hence increases memory dramatically as the file size gets larger.
For instance if I have a file 10 MB, and am creating patches with 10 other files, the memory shoots up to 1.5 GB for one thread alone. If "StringBuilder" is used, it will limit the usage to 200 MB or so.
Is there a way to change the "String" usage to either "StringBuffer" or "StringBuilder" (preferably the latter) to make it more memory efficient and maybe use "static ThreadLocal" variables.? Any help is appreciated.
Thanks,
AR.