On Sat, Sep 12, 2015 at 7:49 AM, André Warnier (tomcat) <a...@ice-sa.com> wrote:
> On 11.09.2015 18:24, Caldarale, Charles R wrote: > >> From: Leo Donahue [mailto:donahu...@gmail.com] >>> Subject: Re: heap thrashing >>> >> >> I see this topic come up from time to time on the list. Can someone point >>> me to what heap thrashing looks like? >>> >> >> Is heap thrashing a very "closely spaced" saw tooth pattern? >>> >> >> Should have mentioned that "heap thrashing" does not have a strict >> definition. Often, it's used to describe the heap itself expanding and >> contracting in a cyclic manner. This is most easily avoided by setting the >> min and max heap size limits to the same value. >> >> What you have appears to be just very rapid object creation and garbage >> collection. Using a larger heap (if you have the RAM for it) could help to >> reduce the frequency of collections. Fixing the webapp to not consume so >> much space would be better, of course. >> >> - Chuck >> > > In terms of looking at the webapp code which may generate that kind of > behaviour, while searching for an example on the www, I came across this > blog post : > > http://steve-yegge.blogspot.de/2006/03/execution-in-kingdom-of-nouns.html > > Independently of what one may think about the author's opinions and > treatment of the matter, I find the prose beautiful and witty. > The pseudo-java code example is of course tongue-in-cheek and contrived, > but I have seen similar code in the real world, and it would probably > produce the kind of phenomenon which Leo is seeing. > André, Nice article, hard to believe that was nearly 10 years ago. I also see the overuse of nouns as verbs and factory patterns that are only producing a single object and will never add additional ones. I see people using "private static" in place of a singleton pattern. I see people still catching Throwable and deferring exceptions as RuntimeExceptions instead of declaring them. I digress. Leo