Cris,

On 7/25/2016 6:17 AM, Berneburg, Cris J. - US wrote:
> Mark (Eggers)
> 
> -----Original Message----- From: Mark Eggers
> [mailto:its_toas...@yahoo.com.INVALID] Sent: Friday, July 22, 2016
> 1:28 PM To: Tomcat Users List Subject: Re: OutOfMemoryError: PermGen
> space - SOLVED
> 
>> Cris,
>> 
>> On 7/22/2016 10:15 AM, Berneburg, Cris wrote:
>>> Mark (Thomas), Román, Guido, and Mark (Eggers)
>>> 
>>> Thank you all for your suggestions, assistance, and patience.
>>> 
>>> With your help and encouragement I learned how to perform heap
>>> dumps using Java VisualVM, analyze them using Eclipse Memory
>>> Analyzer, and follow instructions.  ;-)
>>> 
>>> [SNIP]
>>> 
>>> I apologize for taking your time and bandwidth on such a newbie 
>>> mistake.
>>> 
>>> Thanks again for your help.  :-)
>>> 
>>> -- Cris Berneburg CACI Lead Software Engineer
>>> 
>>> [SNIP]
>>> 
>>>> Here's the error:
>>>> 
>>>> FAIL - Application at context path /someapp could not be
>>>> started FAIL - Encountered exception
>>>> java.lang.OutOfMemoryError: PermGen space
>>>> 
>> 
>> You're more than welcome. Glad that it was a simple 'read and
>> follow the instructions' problem. Been there, done that, have the
>> palm prints on my forehead.
> 
> I read those Log4J instructions previously
> (https://logging.apache.org/log4j/2.x/manual/webapp.html) but failed
> to notice/remember the bits about the listener and filter.  Sometimes
> I think what happens is that I am so overwhelmed by implementing
> something new to me, with all its complexities, that I miss an
> important detail.  Then afterwards it doesn't seem as complex any
> more.
> 
>> Something I've made a habit of (after getting burned several times
>> by stray threads, threadlocals, and permgen errors) is to search
>> for tomcat / servlet container in the context of using a library
>> when I add a new one to the mix.
>> 
>> That search has saved me lots of grief.
> 
> Would you please explain that?  Do you search through your own source
> code or source code of the new library?
> 
> -- Cris Berneburg CACI Lead Software Engineer
> 

First of all, I'm more of a systems / software architect than a
developer. Since I'm not a diagram-only architect, I do some
development. However, that's mostly proof-of-concept to make sure I
don't create unworkable systems.

For a variety of reasons, I'm moving the company I provide consulting
services to towards Maven. On occasion, the software they develop
requires new functionality. Since they're relatively small, I've
encouraged the use of third party libraries.

Using third party libraries requires a bit of vetting. I'll not go into
detail here (security, liveliness of project, health of community,
fitness of purpose, etc.), but one of the things I search for is how
well does that library play in a servlet container.

Google searches (pick your favorite search engine) are helpful. For
example, here are some searches for the gson library:

gson threadlocal
gson permgen
gson servlet container
gson tomcat
gson memory leak tomcat

If you do these searches, you'll find out that earlier versions of the
gson library had a threadlocal issue which led to a permgen memory leak.

While the initial response from the project was not encouraging
(actually quite discouraging), the issue was finally fixed.

jackson (used as the JSON serialization library in Jersey REST) seems to
have had similar issues at one point.

While the above searches won't catch everything, they do serve as good
starting points.

That plus visualvm (or YourKit or Eclipse MAT) are your friends.

. . . just my two cents
/mde/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to