You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "L. Scott Emmons" <sc...@center.uscs.com> on 2001/04/05 00:11:28 UTC

Memory footprint question re large-scale J2EE deployment

Was curious if anyone has measured the memory footprint of log4j. Some
of our architecture folks are worried that having 100's of classes (EJB,
Servlet, etc) instantiating log4j objects will be a problem. We plan on
using the JMSAppender, if that makes any significant difference.

I'm curious how other folks have implemented log4j in large-scale
projects. Do you instantiate log4j objects in each class?

Thanks,
-Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Memory footprint question re large-scale J2EE deployment

Posted by "L. Scott Emmons" <sc...@center.uscs.com>.
Thanks Michael and Scott for explaining how this works to me. I do
appreciate it greatly, and it helps me understand. While I've been
hacking C for many years, I'm new to Java and struggling a bit with some
of this.

I guess I'm going a bit OT here, as this is a general JVM question, but
I'm trying to get a handle on how this works.

Let's say I have classes A1 and A2, which instantiate objects of class
B. Both A1 and A2 are running in the same JVM.

For the sake of argument, class B is 500 bytes of byte-code, has 10
bytes of class-static data, and 10 bytes of non-static data.

If I understand correctly, there will be 1 copy of class B's 500 byte
code. There will be 1 copy of class B's 10 byte static data. And there
would 2 copies of class B's non-static data, 10 bytes each for A1 and
A2.

Am I getting it?

Again, sorry for taking this OT.
-Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Memory footprint question re large-scale J2EE deployment

Posted by Scott M Stark <Sc...@displayscape.com>.
That is what I meant by Category as well. You should be seeing one
org.apache.log4j.Category created for each unique value passed to
getInstance(). I don't know why this would not show up in profiling.

> 
> I'm sorry, by Category I mean "org.apache.log4j.Category" objects, not
> to be confused with the logging categories - I am familiar with how they
> work.
> 
> i.e: Category cat = Category.getInstance(..)
> 
> I'm attempting to run with -Xrunhprof but for some reason not getting
> any log4j classes in my output.
> 
> Sorry for the confusion,
> -Scott



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Memory footprint question re large-scale J2EE deployment

Posted by "L. Scott Emmons" <sc...@center.uscs.com>.
Scott M Stark wrote:
> 
> You don't have to follow the pattern of having a Category instance per
> class. I use one Category per package and sometimes one Category
> for a logical grouping of packages.

I'm sorry, by Category I mean "org.apache.log4j.Category" objects, not
to be confused with the logging categories - I am familiar with how they
work.

i.e: Category cat = Category.getInstance(..)

I'm attempting to run with -Xrunhprof but for some reason not getting
any log4j classes in my output.

Sorry for the confusion,
-Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


my log4j xml configuration file cannot find dtd unless I use a full http url

Posted by Steven Richard Keech <ke...@qwest.net>.
Our servlet/jsp application runs in Websphere 3.5.3. We developed it in
Visual Age for Java 3.5 with its Websphere Test Environment (WTE). WTE is
simplified version of the real Websphere 3.5 environment.

I'm configuring log4j during the servlet init() method using the
DOMConfigurator.configure(<filename>). I initialize it with the path of my
log4j.xml configuration file. The log4j.dtd is in the same directory as the
log4j.xml and that directory is on the Servlet application class path.

The log4j.xml has the typical header:

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

In the Visual Age for Java WTE, this works fine ... no problem.

But in the Websphere 3.5, same scenario, it doesn't work. The log4j.xml
cannot locate the log4j.dtd. I tried several different relative paths for
"log4j.dtd" to no avail.

Finally, I moved the log4j.dtd into the document root of my webserver and
changed the log4j.xml header to:

<!DOCTYPE log4j:configuration SYSTEM "http://satweb5/log4j.dtd">

This worked fine. However, I prefer the "log4j.dtd" style to
http://satweb5/log4j.dtd because I don't have to reconfigure going from
development to test to production webservers. I also think it would be
faster.

I am sure this problem is just a symptom of how WebSphere 3.5 sets it's
class path and class loader for each web application.

Anybody got any suggestions how I can get the relative path location working
with the log4j.dtd? Is anyone else using log4j in servlets?

Steven Richard Keech




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Memory footprint question re large-scale J2EE deployment

Posted by Scott M Stark <Sc...@displayscape.com>.
You don't have to follow the pattern of having a Category instance per
class. I use one Category per package and sometimes one Category
for a logical grouping of packages. 

----- Original Message ----- 
From: "L. Scott Emmons" <sc...@center.uscs.com>
To: <lo...@jakarta.apache.org>
Sent: Wednesday, April 04, 2001 3:11 PM
Subject: Memory footprint question re large-scale J2EE deployment


> Was curious if anyone has measured the memory footprint of log4j. Some
> of our architecture folks are worried that having 100's of classes (EJB,
> Servlet, etc) instantiating log4j objects will be a problem. We plan on
> using the JMSAppender, if that makes any significant difference.
> 
> I'm curious how other folks have implemented log4j in large-scale
> projects. Do you instantiate log4j objects in each class?
> 
> Thanks,
> -Scott
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org