Bug 33544 - Memory spike during checkout
Summary: Memory spike during checkout
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Jean-Michel Lemieux CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate, performance
Depends on:
Blocks:
 
Reported: 2003-02-28 10:19 EST by Michael Valenta CLA
Modified: 2003-06-16 13:43 EDT (History)
0 users

See Also:


Attachments
Optimize-it memory snapshot after GC ran on checkout (496.57 KB, text/html)
2003-03-11 10:37 EST, Jean-Michel Lemieux CLA
no flags Details
Heap size versus actual memory used during checkout (153.66 KB, text/html)
2003-03-11 11:23 EST, Jean-Michel Lemieux CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2003-02-28 10:19:32 EST
If I check out all of Eclipse from CVS, then memeory usage in Windows goes from 
35MB to 247MB. We should investigate this.
Comment 1 Kevin McGuire CLA 2003-02-28 15:44:04 EST
And with just doing an "import" from source?
Comment 2 Michael Valenta CLA 2003-03-11 10:19:51 EST
I didn't try an import since that operation only works on one project at a 
time. However, I tried the operation again with auto-build off and the memory 
usage went from 37MB to 118MB so it CVS is only one of the culprits.

Looking through the code, I also noticed that there are several places that we 
end up creating strings when we don't need to. The most notable are when 
reading info from the server (we read as Strings and then convert to bytes) and 
when wrting to disk (we wrap in a String to use a String based write method).
Comment 3 Jean-Michel Lemieux CLA 2003-03-11 10:37:23 EST
Created attachment 3984 [details]
Optimize-it memory snapshot after GC ran on checkout
Comment 4 Jean-Michel Lemieux CLA 2003-03-11 11:05:37 EST
I tried to find out the following:

Q1. How much memory does the CVS plugins require from the heap to maintain it's
internal data structures for several checked out projects?

A1. For all of jdt and team plugins checked out from CVS the session properties
in core require 1.8 MBs. And the remaining memory for internal data structures
as shown in the 3984 attachement shows a minimal amount (e.g. < 5 MB). Nowhere
near the numbers as seen in the task list.

Q2. How much of the memory the task list shows as "being used" is actually
handles that are a direct result of the CVS plugin.

A2. The value shown in the task list is misleading since it actually shows the
memory "reserved" by the vm and not necessarily "used". This was confirmed using
Optimize-it to view the Heap size and actual memory used. 

Summary:
=======

1. Reducing the memory spikes can help reduce the amount of heap the vm
reserves. Michael has already identified some areas in the CVS plugin where some
optimizations could be made.

2. The CVS plugin doesn't appear to hog too much heap for CVS related
meta-information for shared projects. In any case, the numbers found with
Optimize-it support this claim.

3. The memory used for CVS sync information in session properties seems
reasonable (e.g. < 2MB)
Comment 5 Jean-Michel Lemieux CLA 2003-03-11 11:23:27 EST
Created attachment 3993 [details]
Heap size versus actual memory used during checkout

This patch shows how memory spikes affect the heap memory reserved by the vm.
The '*' at time 9:30 shows the memory before the checkout. The end of the data
represents the end of the checkout and build.


Before checkout (empty workspace): 22MB (actual), 48MB (heap)
After checkout: 		   47MB (actual), 65MB (heap)
Restart of workbench:		   46MB (actual), 65MB (heap)
Comment 6 Jean-Michel Lemieux CLA 2003-06-16 13:43:37 EDT
Finished investigation for 2.1.