Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315858 - String.substring can waste memory
Summary: String.substring can waste memory
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 7.0.2.RC0   Edit
Assignee: Simone Bordet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-04 19:33 EDT by Greg Wilkins CLA
Modified: 2013-02-13 09:40 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Wilkins CLA 2010-06-04 19:33:54 EDT
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513622

thus it may be better to wrap calls to substring in a call to new String(), so that short strings do not hold the larger strings in memory.
Comment 1 Simone Bordet CLA 2013-02-13 09:40:15 EST
JDK bug #4513622 has been fixed in JDK 7u6, as reported in the JDK bug report.
No longer an issue.