https://issues.apache.org/bugzilla/show_bug.cgi?id=53401
Priority: P2
Bug ID: 53401
Assignee: [email protected]
Summary: Request objects use too much memory!
Severity: normal
Classification: Unclassified
OS: All
Reporter: [email protected]
Hardware: All
Status: NEW
Version: unspecified
Component: Catalina
Product: Tomcat 7
AsyncContext hold a org.apache.catalina.connector.Request object,
request object hold a InputBuffer object,
InputBuffer's default size is 8*1024 !
When I made a Comet server, I needed to hold the AsyncContext object, but the
Request object occupy too much memory, 3000 connections used 250MB memory! But
InputBuffer is not necessary!
Java test code:
public static void main(String[] args) throws IOException {
Map<Serializable, Object> socketStore = new
ConcurrentHashMap<Serializable, Object>();
for (int i = 0; i < 8000; i++) {
Request request = new Request();
socketStore.put("asdfsdfsadfa" + i, request);
}
MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
MemoryUsage memoryUsage = memoryMXBean.getHeapMemoryUsage();
long usedBytes = memoryUsage.getUsed();
System.out.println("used :" + usedBytes / 1024 / 1024 + " MB");
// used :225 MB
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]