User forums > General (but related to Code::Blocks)
Valgrind and Cachegrind
(1/1)
Evan:
I'm testing my C99 code, that seems to run as intended and I'm using valgrind-3.22.0. on Linux Mint 22.3 and Code::Blocks Build: 2024-03-31
command: valgrind --leak-check=full --track-origins=yes --xml=yes
-------------- Application output --------------
I hope that means no memory leaks and my System Monitor is not showing any leaks/peaks.
Cachegrind however gives a message: brk segment overflow in thread #1: can't grow to 0x4856000
valgrind --version
valgrind-3.22.0
valgrind --tool=cachegrind "/home/C/Test/bin/Debug/Test"
==33537== Cachegrind, a high-precision tracing profiler
==33537== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==33537== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==33537== Command: /home/C/Test/bin/Debug/Kalechen
==33537==
==33537== brk segment overflow in thread #1: can't grow to 0x4856000
==33537== (see section Limitations in user manual)
==33537== NOTE: further instances of this message will not be shown
==33537==
==33537== I refs: 5,078,382,897
Any help is appreciated?
Miguel Gimenez:
--- Quote ---==33537== (see section Limitations in user manual)
--- End quote ---
--- Quote ---On Linux, Valgrind determines at startup the size of the 'brk segment' using the RLIMIT_DATA rlim_cur, with a minimum of 1 MB and a maximum of 8 MB. Valgrind outputs a message each time a program tries to extend the brk segment beyond the size determined at startup. Most programs will work properly with this limit, typically by switching to the use of mmap to get more memory. If your program really needs a big brk segment, you must change the 8 MB hardcoded limit and recompile Valgrind.
--- End quote ---
The segment is trying to grow to 72 MB, far higher than the 8 MB limit. If you are using malloc() to allocate memory you can ignore this message.
Evan:
Thanks.
Navigation
[0] Message Index
Go to full version