Hi, >I calculated the number of inserted code lines versus the amount and >ratio of bytes have increased the class files. > >Here are the results of my investigations: > >Test Application: 1) naked 2) println() 3) logging() >total Code lines: 420 435 440 >print/log Code lines: 0 15 20 >total class bytes: 17118 18054 18892 >code line ratio: - 3,4 % 4,5 % >class byte ratio: - 5,5 % 10,4 % > >Conclusion: >Replacing legacy System.out.println() by logging with log4j doubles the >amount of memory used in addition to a naked (non traced) application.
What you've done is calculate file sizes, and that's fine, but doesn't say anything about runtime memory usage. Memory usage switching from System.out.println() to log4j certainly doesn't double for any real-world application. (Of course, 400 LOC is unlikely to be a real-world application anyhow, this is just a test, I understand). >So if we were stingy logging, it wouldn't burst our system. >But the library log4j-1.2.8.jar could be too big for us. >Is it possible to simply remove unused classes - as for instance xml - >from the library to slim it? I don't know, I haven't tried. You would need to be careful to remove only unreferenced classes: for example, you can't remove WriterAppender, even though you don't use it directly, because you use FileAppender. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]