thanks a lot for your prompt answer.
Ralf.
Shapira, Yoav schrieb:
Hi,The measurement of runtime memory usage doesn't show any significant difference between logging and System.out.println() or the “naked” application. The ratio was in range of 0.5 % and sometimes logging was smaller then the naked one.
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).
In our embedded system the applications are running on cheap RAM memory, but the class and jar files are located on expensive flash memory. Therefore I took a look for the file sizes.
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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
