Valgrind-memcheck tool Command Options

Source: Internet
Author: User

-- Leak-check = <no | summary | Yes | full>: if it is set to yes or full, valgrind will detail each memory leak after the program is called, the default value is summary. Only several memory leaks are reported.

-- Show-possibly-lost = <Yes | NO>: The default value is yes. If it is set to no, the memory leakage check will not show the "possibly lost" blocks.

-- Leak-resolution = <low | med | high>: This option sets the memory check tool to detect multiple memory leaks, how to attribute these memory leaks to the same leak (which is caused by the same reason ). When it is set to low, it tries to merge the first two leaks. If it is set to Med, it is the first four. The default value is high. It tries to merge all leaks. This option does not affect memcheck's ability to find and leak, but only affects the display of its detection results.

-- Show-reachable = <Yes | NO>: The default value is no. That is, the memory leak detection tool only displays "definitely lost" and "possibly lost" blocks, if yes is enabled, "reachable" and "indirectly lost" blocks will be displayed. That is to say, the leaked blocks will be displayed in addition to those supported, in fact, the name of this option is changed to -- show-all.

-- UNDEF-value-errors = <Yes | NO>: The default value is yes, that is, memcheck reports a reference undefined error (uses of undefined value errors), which has a slight impact on the detection speed.

-- Track-origins = <Yes | NO>: This option controls whether memcheck traces the root cause of the uninitialized value reference error. By default, tracing is not performed, that is, it tells you that the program references an uninitialized value, but you do not know where the uninitialized value comes from. If it is set to yes, memcheck will track uninitialized sources. This source may occur in the following four situations: Stack, stack, clent requist, and others. For uninitialized values from the heap block, memcheck displays where the block is allocated. For uninitialized values on the stack, memcheck will tell you which function is used. The overhead of this option is quite large. This option cannot be used with -- UNDEF-value-errors = No.

-- Partial-loads-OK = <Yes | NO>: This option determines how memcheck processes the loading of word-sized and word-aligned data (from addresses, the address of some byte blocks in the SES SSEs can be re-allocated, and the rest cannot. If it is set to yes, this loading will not produce any errors. When loading bytes from an Invalid Address, it will be marked as uninitialised. If it is loaded from a valid address, it will be processed normally. The default value is no. Loading from some invalid addresses is the same as loading from completely invalid addresses. Illegal address errors will be reported, the corresponding byte block is marked as initialised. In fact, such code does not conform to ISO
C/C ++ standard, which should be regarded as a broken. In any case, such code should be corrected. This option should be used as the final means.

-- Freelist-Vol = <number>: when a customer program uses free or delete to release a memory block, the block is not immediately available for redistribution, it will only be placed in a freed blocks Queue (freelist) and marked as inaccessible, in order to delay the released block for reuse again (Time ?) This helps to detect the access errors of released blocks by the customer program after a very important period of time. This option specifies the size of the bytes occupied by the queue. The default value is 20 mb. Increasing this option will increase the memory overhead of memcheck, but the error checking capability will also be improved.

-- Freelist-big-blocks = <number>: when the available memory block is retrieved from the freelist queue for redistribution, memcheck extracts a block from memory blocks larger than the number by priority. This option prevents frequent calls of small memory blocks in freelist. This option increases the chance of detecting a wild Pointer Error for small memory blocks. If this option is set to 0, all blocks are allocated based on the principle of first-in-first-out. The default value is 1 MB.

-- Workaround-gcc296-bugs = <Yes | NO>: If this option is enabled, no error will be reported when reading and writing not far from the top pointer of the stack (gcc2.96 bug), the default is 256b, the default value is no. Do not enable this option as far as possible, because it may cause errors and is hard to detect. The solution is to use the latest GCC, which will correct this error. This option may be used in earlier GCC versions.

-- Ignore-ranges = 0xpp-0xqq [, 0xrr-0xss]: addresses between these ranges will be omitted during memcheck addressing. Multiple Address ranges can be separated by commas. (Letters should be replaced by numbers)

-- Malloc-fill =

-- Free-fill =

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.