You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Caldarale, Charles R" <Ch...@unisys.com> on 2007/08/01 00:13:27 UTC

RE: Recovery from OutOfMemoryError?

> From: Leon Rosenberg [mailto:rosenberg.leon@googlemail.com] 
> Subject: Re: Recovery from OutOfMemoryError?
> 
> Thats however strongly depend on where it happened... if for example
> the code in question was a middleware stub which is left in
> unpredictable state, or the orb itself, or any kind of stack
> somewhere, or a processing queue, or some background threads... or 3rd
> party libraries...

Agreed - but the above defines software of somewhat questionable
quality, not written with robustness in mind.  But if it's not a
critical environment, the occasional outage may not matter, so robust
algorithms are not always needed.

> I think there are very few places where an oome should be caught and
> can be handled properly, or you have to surround each new with
> try/catch....

Certainly you don't want try/catch everywhere, but as you say, it is
needed in state-altering places so that restoration to a usable
condition can be done when necessary.  Employing techniques such as
acquiring all necessary data structures before manipulating pointers in
doubly-linked lists go a long way towards eliminating the need for
complex backout mechanisms; but these often aren't learned until
something catastrophic happens.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Recovery from OutOfMemoryError?

Posted by Leon Rosenberg <ro...@googlemail.com>.
On 8/1/07, Caldarale, Charles R <Ch...@unisys.com> wrote:

> ... but these often aren't learned until
> something catastrophic happens.
>

great sentence :-)
Leon

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: APR Library with JBoss/Tomcat

Posted by Len Popp <le...@gmail.com>.
As the log message says, what you need is the Apache Tomcat Native
library. (The APR is one part of that.)
The Tomcat docs have a page about this - for example,
http://tomcat.apache.org/tomcat-5.5-doc/apr.html for version 5.5.
That page points to a download page that has both source and compiled
binaries for Windows: http://tomcat.heanet.ie/native/
-- 
Len

On 8/5/07, Sam Klin <sa...@twinix.com> wrote:
> I notice my new version of JBoss (4.2.1GA) gives the following message in
> the server logs:
>
> 2007-08-05 15:41:32,650 INFO
> [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native
> library which allows optimal performance in production environments was not
> found on the java.library.path: ../lib
>
> I wen't to the Apche APR site (a more cryptic site is hard to imagine. :):))
> And downloaded the source code for Windows. I build the apr library using
> Visual C++ now my question is where does the static library go? Does Tomcat
> have to be built using this library or can it be dropped in the Java library
> path has the message above says. The APR site is silent about how to
> actually deploy this library.
>
> Thanks for any help.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: APR Library with JBoss/Tomcat

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ron Wheeler [mailto:rwheeler@artifact-software.com] 
> Subject: Re: APR Library with JBoss/Tomcat
> 
> The error message does not describe the problem appropriately and the 
> documentation does not clearly link to this "required" library.

It's not an error message - it's clearly labeled INFO.  Nor is the
library required; Tomcat functions quite happily without it.

A cursory examination of Tomcat's APR documentation shows this:
http://tomcat.apache.org/tomcat-6.0-doc/apr.html

"Windows binaries are provided for tcnative-1, which is a statically
compiled .dll which includes OpenSSL and APR. It can be downloaded from
_here_ as 32bit or AMD x86-64 binaries."

No source download or building is required for Windows platforms.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: APR Library with JBoss/Tomcat

Posted by Ron Wheeler <rw...@artifact-software.com>.
Could someone post a bug against this.
The error message does not describe the problem appropriately and the 
documentation does not clearly link to this "required" library.

This gets everyone the first time that Tomcat is installed and it takes 
a long time to find the library required.

It never seems to get fixed even though it has been a problem for 
several generations so far.

Ron


Len Popp wrote:
> On 8/5/07, Len Popp <le...@gmail.com> wrote:
>   
>> tcnative-1.dll goes in the Tomcat bin subdirectory.
>>     
>
> ... except I see that you're running JBoss, so maybe that's not
> correct for you. Sorry again. :-) I guess you'll have to check the
> JBoss documentation to see where it likes to keep DLLs. As a last
> resort, c:\windows\system32 will work.
>   

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: APR Library with JBoss/Tomcat

Posted by Len Popp <le...@gmail.com>.
On 8/5/07, Len Popp <le...@gmail.com> wrote:
> tcnative-1.dll goes in the Tomcat bin subdirectory.

... except I see that you're running JBoss, so maybe that's not
correct for you. Sorry again. :-) I guess you'll have to check the
JBoss documentation to see where it likes to keep DLLs. As a last
resort, c:\windows\system32 will work.
-- 
Len

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: APR Library with JBoss/Tomcat

Posted by Len Popp <le...@gmail.com>.
tcnative-1.dll goes in the Tomcat bin subdirectory.
(Sorry for the misunderstanding. I thought you meant you'd built a
static APR lib rather than the DLL.)
-- 
Len

On 8/5/07, Sam Klin <sa...@twinix.com> wrote:
> I saw all that but again it doesn't say where those dlls get deployed...? I
> was able to build everything myself from the source code that the APR
> project provides but there's no document that talks about deployment. If you
> can point me towards a link that talks about the deployment I would be
> grateful.
>
> ----- Original Message -----
> From: "Len Popp" <le...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Sunday, August 05, 2007 4:51 PM
> Subject: Re: APR Library with JBoss/Tomcat
>
>
> > As the log message says, what you need is the Apache Tomcat Native
> > library. (The APR is one part of that.)
> > The Tomcat docs have a page about this - for example,
> > http://tomcat.apache.org/tomcat-5.5-doc/apr.html for version 5.5.
> > That page points to a download page that has both source and compiled
> > binaries for Windows: http://tomcat.heanet.ie/native/
> > --
> > Len
> >
> > On 8/5/07, Sam Klin <sa...@twinix.com> wrote:
> > > I notice my new version of JBoss (4.2.1GA) gives the following message
> in
> > > the server logs:
> > >
> > > 2007-08-05 15:41:32,650 INFO
> > > [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native
> > > library which allows optimal performance in production environments was
> not
> > > found on the java.library.path: ../lib
> > >
> > > I wen't to the Apche APR site (a more cryptic site is hard to imagine.
> :):))
> > > And downloaded the source code for Windows. I build the apr library
> using
> > > Visual C++ now my question is where does the static library go? Does
> Tomcat
> > > have to be built using this library or can it be dropped in the Java
> library
> > > path has the message above says. The APR site is silent about how to
> > > actually deploy this library.
> > >
> > > Thanks for any help.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
> ----- Original Message -----
> From: "Sam Klin" <sa...@twinix.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Sunday, August 05, 2007 4:27 PM
> Subject: APR Library with JBoss/Tomcat
>
>
> > I notice my new version of JBoss (4.2.1GA) gives the following message in
> > the server logs:
> >
> > 2007-08-05 15:41:32,650 INFO
> > [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native
> > library which allows optimal performance in production environments was
> not
> > found on the java.library.path: ../lib
> >
> > I wen't to the Apche APR site (a more cryptic site is hard to imagine.
> :):))
> > And downloaded the source code for Windows. I build the apr library using
> > Visual C++ now my question is where does the static library go? Does
> Tomcat
> > have to be built using this library or can it be dropped in the Java
> library
> > path has the message above says. The APR site is silent about how to
> > actually deploy this library.
> >
> > Thanks for any help.
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: APR Library with JBoss/Tomcat

Posted by Sam Klin <sa...@twinix.com>.
I saw all that but again it doesn't say where those dlls get deployed...? I
was able to build everything myself from the source code that the APR
project provides but there's no document that talks about deployment. If you
can point me towards a link that talks about the deployment I would be
grateful.

----- Original Message ----- 
From: "Len Popp" <le...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Sunday, August 05, 2007 4:51 PM
Subject: Re: APR Library with JBoss/Tomcat


> As the log message says, what you need is the Apache Tomcat Native
> library. (The APR is one part of that.)
> The Tomcat docs have a page about this - for example,
> http://tomcat.apache.org/tomcat-5.5-doc/apr.html for version 5.5.
> That page points to a download page that has both source and compiled
> binaries for Windows: http://tomcat.heanet.ie/native/
> -- 
> Len
>
> On 8/5/07, Sam Klin <sa...@twinix.com> wrote:
> > I notice my new version of JBoss (4.2.1GA) gives the following message
in
> > the server logs:
> >
> > 2007-08-05 15:41:32,650 INFO
> > [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native
> > library which allows optimal performance in production environments was
not
> > found on the java.library.path: ../lib
> >
> > I wen't to the Apche APR site (a more cryptic site is hard to imagine.
:):))
> > And downloaded the source code for Windows. I build the apr library
using
> > Visual C++ now my question is where does the static library go? Does
Tomcat
> > have to be built using this library or can it be dropped in the Java
library
> > path has the message above says. The APR site is silent about how to
> > actually deploy this library.
> >
> > Thanks for any help.
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

----- Original Message ----- 
From: "Sam Klin" <sa...@twinix.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Sunday, August 05, 2007 4:27 PM
Subject: APR Library with JBoss/Tomcat


> I notice my new version of JBoss (4.2.1GA) gives the following message in
> the server logs:
>
> 2007-08-05 15:41:32,650 INFO
> [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native
> library which allows optimal performance in production environments was
not
> found on the java.library.path: ../lib
>
> I wen't to the Apche APR site (a more cryptic site is hard to imagine.
:):))
> And downloaded the source code for Windows. I build the apr library using
> Visual C++ now my question is where does the static library go? Does
Tomcat
> have to be built using this library or can it be dropped in the Java
library
> path has the message above says. The APR site is silent about how to
> actually deploy this library.
>
> Thanks for any help.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


APR Library with JBoss/Tomcat

Posted by Sam Klin <sa...@twinix.com>.
I notice my new version of JBoss (4.2.1GA) gives the following message in
the server logs:

2007-08-05 15:41:32,650 INFO
[org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native
library which allows optimal performance in production environments was not
found on the java.library.path: ../lib

I wen't to the Apche APR site (a more cryptic site is hard to imagine. :):))
And downloaded the source code for Windows. I build the apr library using
Visual C++ now my question is where does the static library go? Does Tomcat
have to be built using this library or can it be dropped in the Java library
path has the message above says. The APR site is silent about how to
actually deploy this library.

Thanks for any help.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Recovery from OutOfMemoryError?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Subject: Re: Recovery from OutOfMemoryError?
> 
> I generally think of this as "failure return" as simply allowing the
> exception to propagate.

That can work, but since OOMEs don't require "throws" declarations on
methods, it's usually better for the lump of code that took the original
hit to wrapper the OOME in something unique to the function.  This also
helps in getting the programmers who write code that calls the lump in
question to think about the issue.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Recovery from OutOfMemoryError?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
>> Subject: Re: Recovery from OutOfMemoryError?
>>
>> Are you suggesting that all methods should be written as a 
>> loops around attempts to do real work, catching OOME and 
>> re-trying until the work gets done?
> 
> Sort of, but not at the method level - something on a larger scale.
> Think recoverable database operations, where nothing is permanently
> stored until a commit happens.  And perpetual retry isn't needed - just
> a failure return to the caller.

I generally think of this as "failure return" as simply allowing the
exception to propagate.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsIuK9CaO5/Lv0PARAgchAJwNisfWQClMub7qmUj8/smKxbonVwCfQDrb
bwYmaWlh5u+7gClpLMq41KI=
=iOsg
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Recovery from OutOfMemoryError?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Subject: Re: Recovery from OutOfMemoryError?
> 
> Are you suggesting that all methods should be written as a 
> loops around attempts to do real work, catching OOME and 
> re-trying until the work gets done?

Sort of, but not at the method level - something on a larger scale.
Think recoverable database operations, where nothing is permanently
stored until a commit happens.  And perpetual retry isn't needed - just
a failure return to the caller.

> IMHO, it's not a library's problem if there wasn't enough memory to
> perform its duty. It's the driver's responsibility to catch and
> re-attempt anything important.

Agreed.  Unfortunately, many such drivers seem to ignore the possibility
of failure of libraries.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Recovery from OutOfMemoryError?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

Caldarale, Charles R wrote:
>> From: Leon Rosenberg [mailto:rosenberg.leon@googlemail.com] 
>> Subject: Re: Recovery from OutOfMemoryError?
>>
>> Thats however strongly depend on where it happened... if for example
>> the code in question was a middleware stub which is left in
>> unpredictable state, or the orb itself, or any kind of stack
>> somewhere, or a processing queue, or some background threads... or 3rd
>> party libraries...
> 
> Agreed - but the above defines software of somewhat questionable
> quality, not written with robustness in mind.  But if it's not a
> critical environment, the occasional outage may not matter, so robust
> algorithms are not always needed.

Are you suggesting that all methods should be written as a loops around
attempts to do real work, catching OOME and re-trying until the work
gets done? That's what it sounds like, here.

IMHO, it's not a library's problem if there wasn't enough memory to
perform its duty. It's the driver's responsibility to catch and
re-attempt anything important.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGr7gq9CaO5/Lv0PARAjYhAJ0eyYzCaDls9rsjrvoJS6xu6XogCgCeKgr+
acntG1IntJLIABNbcEFKOh0=
=thpd
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org