Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315858

Summary: String.substring can waste memory
Product: [RT] Jetty Reporter: Greg Wilkins <gregw>
Component: serverAssignee: Simone Bordet <simone.bordet>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jetty-inbox
Version: 7.1.0   
Target Milestone: 7.0.2.RC0   
Hardware: All   
OS: All   
Whiteboard:

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.