3 ms·
It is not in my opinion. With modern development tools/frameworks providing memory leaks detection I have completely forgotten when was the last time that my pr
by FpUser 7y ago
It is not in my opinion. With modern development tools/frameworks providing memory leaks detection I have completely forgotten when was the last time that my programs leaked memory. And I write complex high performance game servers that run for months non stop. You just have to acquire certain culture/behavior when writing code.
- crimsonalucard 7y agoWhat languages/tools/frameworks/behavior are you using to develop these game servers with no leaking memory?
- gravypod 7y agoI've found valgrind and the clang static analysis tools to be a pretty nice combo.
- FpUser 7y agofor c/c++ I use Visual Leak Detector and Valgrind. For Delphi/FreePascal/Lazarus there are built-in tools and also MadExcept . Behavior/patterns are different depending on task/language but generally when writing code if I want to allocate anything I first write deallocation code.
- NoOn3 7y agoWhat tools for memory leaks detection you can suggest?
- mhh__ 7y agoValgrind (Which also has a bunch of other stuff like cachegrind, which can be a godsend if you are getting telltale cache/branch prediction issues but you can't find where etc.). Clang/GCC both have suites of sanitizers which are usually excellent and easy to grok, these are also available in many language frontends based on LLVM (and maybe GCC?) You can just throw every tool you can find at your CI if you're paranoid, too.
- mhh__ 7y agoAll the code I write at the moment is GC-free (By circumstance), but it's clear that not using a garbage collector is a tradeoff between runtime nondeterminism and the complexity of the code (How many of Herb Sutter's talks on smart pointers could have been eliminated if C++ had a garbage collector available, for example) or compiler/language complexity
- mhh__ 7y agoAlso, Garbage Collection can be extremely fast when done properly: The Decision to use a garbage collector could be done on performance grounds as well but Garbage Collectors are generally harder to tune than reference counting.