From: D. L. <lo...@no...> - 2003-04-29 09:54:37
|
Hi Bastiaan, hi Jon >>>* in general cleaning up at program exit looks nice but is a waste of >>>resources (all remaining memory is going to be freed by the OS anyway). >>>OTOH it's nice if the application programmer can choose for herself, for >>>valgrinding,etc. . >> >>With all due respect -- I find log4cpp an invaluable tool for hunting down >>race conditions -- I must disagree with this statement. I've been fairly >>troubled troubled by log4cpp's memory leaks. Same holds true for me. I was teached by my parents to leave the toilet room after usage in a way I would like to see it when I want using it, even if a cleaner will regularyly show up and remove people's 'aehm' mess. And second, I do get a lot of troubles of my colleques if I introduce a libarary, that does not clean up correctly upon exit. You know, those little friendly annoyances day by day. Since my collegues started to tease me, I did the modifications. > Not to be nitpicking, but it does not per se . You're perfectly free to > leave that to a garbage collector for example. Using one would put an > end to so much waisting time with memory administrivia. Unfortunately it > is not an option of a library like log4cpp to force that upon the > application programmer. Yes, but there is no built in garbage collection in C++. One have to choose a different language if he/she wants to use a garbage collector. > One way in which the static leaks differ from the dynamic ones, is that > the latter grow over time, automically making themselves the center of > attention with a decent leak checker. It must not be a dynamic leak, that increases over time. There are static leaks that can be of interest, since something is not destructed correctly upon program exit. I really like the times of winNT where I can allocate memory, do whatever I want to do, open files, alloc semaphores, and whatever. shift-F5 and we have a clean state again. Without any reboot, day by day. (I'm not a win32 fanatic, I simply like the VisualStudio). I'm not sure, wether a stable execution of an environment is possible, if everybody is not cleaning up after himself. > One reason for my remark (other than to camouflage that I've been too > lazy to work on the problem) is that I feel that it's a minor problem Ok, I did it ;-), since I don't have the other problems you describe. > * make PropertyConfigurator extensible for third party Appenders, etc. Yes, have some interest in this, too. * a MDC (mapped diagnostic context) to store tracing level indentation * a Win32 control to configure the logging API * Appenders that can log events into a CListCtrl with column selection and all that stuff. I use the CEditLog from (http://www.codeproject.com/editctrl/editlog.asp) to log formatted messages to an application provided CEditCtrl right now. You mentioned COM need to shutdown earlier than program exit (DllDetach). I have no experience on this. I just found that someone else also had a simliar problem in a Win32 environment and suggested a solution with a more or less private AtExit queue. The article can be found here: http://www.codeproject.com/cpp/atinitexitinstance.asp > Yes, but also all references to log Categories need to be taken into > account, since the destructors of static objects may want to log as > well. So I guess all Category& occurences need to be replaced with > boost::shared_ptr's or similar. > That's not a trivial change..... but for 0.4.x it should be OK. I thought of that, too. But as you said, it is not a trivial change, and further it has some external visible changes. Therefor I decided to cleanup within the library, and stick to the policy to only use static Categories in static objects destructors. In this case the shutdown procedure will be delayed until the last destructor using the logging API is executed. >>I just got laid off. I've got a lot of work to do finding a new job, but I'd I which you lots of luck. >>be happy to work on this problem with someone else (Dirk?). I haven't used boost much up to now, I have looked into the sources to understand the concepts behind it. But I would like to help. Dirk |