I just cloned the git repository for the SBJson framework and imported the source code into my application. Ran a Static Memory profiler and got a little scared from the results I saw. See the picture
How is this possible? I doubt the developer of this very well known library didn't see this? And indeed, if a run a memory profile it shows memory leaks from this library.
Any ideas? Thx
DEFINITION A memory leak is the gradual deterioration of system performance that occurs over time as the result of the fragmentation of a computer's RAM due to poorly designed or programmed applications that fail to free up memory segments when they are no longer needed.
Memory leaks are a common error in programming, especially when using languages that have no built in automatic garbage collection, such as C and C++. Typically, a memory leak occurs because dynamically allocated memory has become unreachable.
No, memory leaks by themselves would not cause a segmentation fault. However, memory leaks usually indicate sloppy code, and in sloppy code other issues, which would cause a segmentation fault, are likely to be present.
It looks like you're using SBJSON in a project that doesn't have ARC enabled. Since ARC removes the need to call release
explicitly, code written for ARC (like SBJSON) causes memory leaks when used in a non-ARC project. You should convert your project to use ARC with the built-in refactoring tool (Edit > Refactor > Convert to Objective-C ARC, then explicitly set the -fno-objc-arc
compiler flag on any of your source that is not yet ARC-ready.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With