digitalmars.D - GC & IRC Server
- Mengu (5/5) Jul 27 2010 Hi all,
- Sean Kelly (6/13) Jul 27 2010 Looks like wm4 is saying that false references will kill any long-runnin...
- bearophile (4/5) Jul 27 2010 But I/we don't know if or how well it works yet :-)
- Leandro Lucarella (16/20) Jul 27 2010 I did some testing, is not exhaustive at all, but it may give you some
- Rory Mcguire (7/30) Jul 27 2010 Surely all programs that have logging use the GC extensively? I have had...
- Sean Kelly (2/6) Jul 27 2010 I would certainly hope not. Loggers shouldn't allocate any memory at al...
- Rory Mcguire (3/16) Jul 29 2010 :D okay, so you're saying avoid string concatenate as much as possible?
Hi all, I was reading an IRC server's codes which was C++ and thought how possible it was with D and started a discussion in the #d room in freenode. Yet I'm very confused right now. Please go ahead and read the logs here: http://pastie.org/1061905 Please let me know what you guys think on this issue.
Jul 27 2010
Mengu Wrote:Hi all, I was reading an IRC server's codes which was C++ and thought how possible it was with D and started a discussion in the #d room in freenode. Yet I'm very confused right now. Please go ahead and read the logs here: http://pastie.org/1061905 Please let me know what you guys think on this issue.Looks like wm4 is saying that false references will kill any long-running app. That is, that because the GC is conservative it may treat some memory locations as pointers that really aren't pointers, which will in turn prevent the GC from collecting memory that has no actual references to it. Three thoughts: 1. There's a precise scanning patch in bugzilla right now. If applied, this should largely eliminate this issue. 2. This is only an issue for certain apps in the first place. Something like an IRC server isn't likely to encounter this problem given the sort of data it operates on. 3. A performance-minded server app isn't going to work the GC heavily anyway. In fact, with slices and such, D server apps of this sort don't have to use the GC at all once the initial startup routine has completed. In short, there's nothing preventing D from being a perfect language for this sort of work. Like anything else, what you get out of an app depends on the work you put into it.
Jul 27 2010
Sean Kelly:1. There's a precise scanning patch in bugzilla right now. If applied, this should largely eliminate this issue.But I/we don't know if or how well it works yet :-) Bye, bearophile
Jul 27 2010
bearophile, el 27 de julio a las 12:45 me escribiste:Sean Kelly:I did some testing, is not exhaustive at all, but it may give you some idea of what to expect. My conclusion is that this *first* approach is not as good as conservative scanning for some programs, but the (Tango) runtime patch is extremely simple and there are some optimization opportunities. All this keeping the current GC design, but the compiler patch open the possibilities of new designs that take better advantage of the type information. -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- Does humor belong in music? -- Frank Zappa Yes it does, Frank. -- Kevin Johansen1. There's a precise scanning patch in bugzilla right now. If applied, this should largely eliminate this issue.But I/we don't know if or how well it works yet :-)
Jul 27 2010
Sean Kelly wrote:Mengu Wrote:Surely all programs that have logging use the GC extensively? I have had a problem with Java and log4j where the entire heap gets used up and its mostly because of unfreed concatenation of strings for logging e.g.: logger.info("connection from"~ socket.remoteAddress()); lazy helps when logging is off but only then. -RoryHi all, I was reading an IRC server's codes which was C++ and thought how possible it was with D and started a discussion in the #d room in freenode. Yet I'm very confused right now. Please go ahead and read the logs here: http://pastie.org/1061905 Please let me know what you guys think on this issue.Looks like wm4 is saying that false references will kill any long-running app. That is, that because the GC is conservative it may treat some memory locations as pointers that really aren't pointers, which will in turn prevent the GC from collecting memory that has no actual references to it. Three thoughts: 1. There's a precise scanning patch in bugzilla right now. If applied, this should largely eliminate this issue. 2. This is only an issue for certain apps in the first place. Something like an IRC server isn't likely to encounter this problem given the sort of data it operates on.
Jul 27 2010
Rory Mcguire Wrote:Surely all programs that have logging use the GC extensively? I have had a problem with Java and log4j where the entire heap gets used up and its mostly because of unfreed concatenation of strings for logging e.g.: logger.info("connection from"~ socket.remoteAddress());I would certainly hope not. Loggers shouldn't allocate any memory at all, except perhaps the occasional buffer increase if they're doing something tricky. I can't believe anyone would create a logger that expected the user to perform string concatenation for formatted output. Then again, the Java standard library churns through memory like a Tasmanian Devil on an eating binge, so perhaps I shouldn't be terribly surprised.
Jul 27 2010
Sean Kelly wrote:Rory Mcguire Wrote::D okay, so you're saying avoid string concatenate as much as possible? Will lots of string concatenates always make the GC go crazy?Surely all programs that have logging use the GC extensively? I have had a problem with Java and log4j where the entire heap gets used up and its mostly because of unfreed concatenation of strings for logging e.g.: logger.info("connection from"~ socket.remoteAddress());I would certainly hope not. Loggers shouldn't allocate any memory at all, except perhaps the occasional buffer increase if they're doing something tricky. I can't believe anyone would create a logger that expected the user to perform string concatenation for formatted output. Then again, the Java standard library churns through memory like a Tasmanian Devil on an eating binge, so perhaps I shouldn't be terribly surprised.
Jul 29 2010