Hi Joel,
see also http://www.eclipse.org/newsportal/article.php?id=3772&group=eclipse.technology.rap#3772
on this. RĂ¼diger pointed out the following in this thread:
"After
processing a request, the preservedValues map is cleared with Map#clear(). This
could be changed to discard of the map (preservedValues = null) if it is proven
that the there is a considerable benefit in memory consumption. On the other
hand, this might have a performance impact when re-creating the map and all its
entries with every request."
So
optimization in this place has to be considered very well to avoid bad
performance due to better memory consumption.
Ciao
Frank
Von: rap-dev-bounces@xxxxxxxxxxx
[mailto:rap-dev-bounces@xxxxxxxxxxx] Im Auftrag von Jochen Krause
Gesendet: Mittwoch, 9. Juli 2008 16:14
An: joel.oliveira@xxxxxxxxxxxxxxxxxxxx; RAP project development-related
communication
Betreff: Re: [rap-dev] RAP memory consumption
Why don't you give the Eclipse Memory Analyzer a try: http://eclipse.org/mat
Here is the link to a heapdump of the RAP demo application
with approx. 1200 active users:
You need to unzip the heapdump before you can feed it to the
Memory Analyzer.
Then run the query on: Java Collections - Collection Fill
Ratio for java.util.Hashmap
Pick one of the result lines (e.g. <=0.0) and choose
"Immediate Dominators" from the context menu.
As I said in my earlier email I do not think this is a
pressing issue. If you want to provide a patch that improves the situation we
would be for sure happy to evaluate it.
Am 09.07.2008 um 15:57 schrieb Joel Oliveira:
Do you have any further information about the Hashmaps that
could be “improved”?
|
|
Software Product Assurance Manager
|
|
Do you rely on your software?
|
DISCLAIMER: This message is confidential and may contain privileged
information. It is for use only by the persons or entities to whom it is
addressed. If you are not an intended recipient, you should not disclose,
distribute, copy, print, rely on or otherwise make use of this message. If an
addressing or transmission error has misdirected it to you we would be grateful
if you would please notify the sender by return, before deleting it from your
system.
is there any literature available regarding the duplicate
Strings problem? I ask this because to my knowledge Strings are unique
within a VM and there's nothing I found by a quick search in the web that
differs from this statement (Maybe I used the wrong query words…):
"The JVM recognises that
the two string literals are identical and only creates a single instance. This
is sensible on the part of the JVM for performance and memory reasons"
So it would be great, if someone
has a link that describes how this problem can happen.
Yesterday I had a memory analyzing
session with an expert from the Eclipse Memory Analyzer team. We had a look at
a heap dump of the RAP Demo Application with a couple of hundred simulated
users.
Here are the most important
results:
Memory consumption of the RAP
framework is very reasonable! This is a great result. Still, there is always
some room for improvement:
There are many duplicated Strings.
A big chunk of those are from widget ids. Moving the implementation to use
String.intern() will probably be a quick and efficient way to improve memory
consumption (only the S.. JVM 1.4 is inefficient with String.intern() ).
Another alternative might be using our own data structure, if we restrict
ourself to UTF-8 we need only 1 Byte per character instead of 2 Byte for String.
Another area for potential
improvement is our use of Hashmaps, We have 172.000 completely empty hashmaps
(530.000 in total).
It seems that WidgetAdapter is
contributing significantly to the large amount of empty hashmaps.
From my point of view this is not
high priority at the moment, but could be researched in one of the upcoming
releases.
P.S: See also the interesting
posting here:
_______________________________________________
rap-dev mailing list
rap-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/rap-dev