Valgrind reporting a segment overflow

前端 未结 5 1088
北荒
北荒 2020-12-16 08:57

When running my program with valgrind / callgrind I get the following message a lot:

==21734== brk segment overflow in thread #1: can\'t grow to 0x4a39000

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 09:31

    Line 1327 from the valgrind source code points to the user manual, "see section Limitations in user manual":

    Limits section item 1:

    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.

提交回复
热议问题