Git Product home page Git Product logo

Comments (19)

wilx avatar wilx commented on May 28, 2024

SocketAppender receiver is source is in the loggingserver.cxx.

Log4jUdpAppender sends the events using UDP to whoever wants to receive them. The other end can be Chainsaw GUI or any other compatible receiver like Log2Console

AsyncAppender is there to outsource possibly time consuming appending to separate thread. It is relevant on older branches than master. On master, there is a thread pool that does that same for all appenders automatically.

SysLogAppender can be used to append against any syslog server. Initially, it was UDP only, newer versions support TCP as well.

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

SocketAppender model has memory leak under high press. It's so ungly, could it will be fixed?
Or give a tiny code analysis.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 I am not aware of any leaks. You will have to specify it a little bit more.

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

briefly, i use SocketAppender as Client Appender, and logginserver.cxx as server.
image

pic is server process by top command .

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

when logger in down, SocketAppender will reopen socket , is that socket release, fd leaks is abvirous.
image

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 OK, that looks like a socket handle leak. What version are you using?

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

version 1.1.2 release
perhaps memory leaks is non-relative with fd leaks, yet that is a problem.
I care about memory leaks as well as fd.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 Well, I do not immediately see anything wrong. Are you able to use something like Valgrind to identify the leak? Also, can you check with master branch?

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

ok, maybe that is only short term solution

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 You said initially, it leaks under high pressure. What kind of pressure is it? Is it possible that, e.g., it is related to connection errors or disconnections?

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

yes, It is related to reconnection.
Both client and server have memory leak at a long term running. fd leaks is obvious.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 TBH, I do not see the leak. I have used performance_test against the loggingserver and I do not see a leak of either FDs or memory. Maybe I am not producing the correct failure mode that triggers it. I do not know.

Which brings me to this: Are you sure your application is not dynamically creating too many loggers with SocketAppenders? The number of loggers should be proportional to code complexity and/or number of modules of the code, and it should not depend on number server clients. E.g., for, say, network server application, you should not be creating separate logger for each client but you should use NDCContextCreator to create NDC context with client identification/information.

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

can you provide loggingserver code, or loggingserver.cxx is same as https://github.com/log4cplus/log4cplus/blob/master/simpleserver/loggingserver.cxx ?

I found line 83 has new operator.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 OK, I see the issue on the line now. I actually did not see it initially, because I have modified the loggingserver code to make testing easier.

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

how your testing easier code deal with the new operator in line 83

from log4cplus.

wilx avatar wilx commented on May 28, 2024

@hlee13 The loggingserver leak should be fixed now on all branches since 1.1.x. Do you see any other leak?

from log4cplus.

hlee13 avatar hlee13 commented on May 28, 2024

There are no up date.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

There are no up date.

I forgot to merge back the changes on 1.2.x branch to log4cplus/log4cplus repository. It is done now. I hope this is why you saw no updates.

from log4cplus.

wilx avatar wilx commented on May 28, 2024

I think this should be fixed now. If you think there are more problems, please either reopen this issue or create a new one.

from log4cplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.