heaptrack | A heap memory profiler for Linux | Monitoring library

 by   KDE C++ Version: v1.3.0 License: No License

kandi X-RAY | heaptrack Summary

kandi X-RAY | heaptrack Summary

heaptrack is a C++ library typically used in Performance Management, Monitoring applications. heaptrack has no bugs, it has no vulnerabilities and it has medium support. You can download it from GitHub.

Heaptrack traces all memory allocations and annotates these events with stack traces. Dedicated analysis tools then allow you to interpret the heap memory profile to:.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              heaptrack has a medium active ecosystem.
              It has 2480 star(s) with 161 fork(s). There are 41 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              heaptrack has no issues reported. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of heaptrack is v1.3.0

            kandi-Quality Quality

              heaptrack has 0 bugs and 0 code smells.

            kandi-Security Security

              heaptrack has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              heaptrack code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              heaptrack does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              heaptrack releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              It has 363 lines of code, 13 functions and 2 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of heaptrack
            Get all kandi verified functions for this library.

            heaptrack Key Features

            No Key Features are available at this moment for heaptrack.

            heaptrack Examples and Code Snippets

            No Code Snippets are available at this moment for heaptrack.

            Community Discussions

            QUESTION

            Why memory profiler doesn't show all the used memory?
            Asked 2021-Jan-07 at 12:54

            When I am starting my application under valgrind with massif option I see 52.6 MiB peak usage. But htop says the process took 875MB of RES memory.

            The same behavior has heaptrack. Does anyone know why profiler doesn't report where 800+MB gone?

            ...

            ANSWER

            Answered 2021-Jan-07 at 12:54

            Massif by default measures only the heap managed by malloc and friends. It doesn't attempt to track pages mapped by other means (for example with mmap).

            In order to account for all pages, one needs to run massif with --pages-as-heap=yes.

            Source: Massif manual.

            Source https://stackoverflow.com/questions/65612418

            QUESTION

            Profiling resident memory usage and many page faults in C++ program on linux
            Asked 2020-May-12 at 03:38

            I am trying to figure out why my resident memory for one version of a program ("new") is much higher (5x) than another version of the same program ("baseline"). The program is running on a Linux cluster with E5-2698 v3 CPUs and written in C++. The baseline is a multiprocess program, and the new one is a multithreaded program; they are both fundamentally doing the same algorithm, computation, and operating on the same input data, etc. In both, there are as many processes or threads as cores (64), with threads pinned to CPUs. I've done a fair amount of heap profiling using both Valgrind Massif and Heaptrack, and they show that the memory allocation is the same (as it should be). The RSS for both the baseline and new version of the program are larger than the LLC.

            The machine has 64 cores (hyperthreads). For both versions, I straced relevant processes and found some interesting results. Here's the strace command I used:

            ...

            ANSWER

            Answered 2020-May-12 at 03:38

            In general: GCC can optimize malloc+memset into calloc which leaves pages untouched. If you only actually touch a few pages of a large allocation, that not happening could account for a big diff in page faults.

            Or does the change between versions maybe let the system use transparent hugepages differently, in a way that happens to not be good for your workload?

            Or maybe just different allocation / free is making your allocator hand pages back to the OS instead of keeping them in a free list. Lazy allocation means you get a soft page fault on the first access to a page after getting it from the kernel. strace to look for mmap / munmap or brk system calls.

            In your specific case, your strace testing confirms that your change led to malloc / free handing pages back to the OS instead of keeping them on a free list.

            This fully explains the extra page faults. A backtrace of munmap calls could identify the guilty free calls. To fix it, see https://www.gnu.org/software/libc/manual/html_node/Memory-Allocation-Tunables.html / http://man7.org/linux/man-pages/man3/mallopt.3.html, especially M_MMAP_THRESHOLD (perhaps raise it to get glibc malloc not to use mmap for your arrays?). I haven't played with the parameters before. The man page mentions something about a dynamic mmap threshold.

            It doesn't explain the extra RSS; are you sure you aren't accidentally allocating 5x the space? If you aren't, perhaps better alignment of the allocation lets the kernel use transparent hugepages where it didn't before, maybe leading to wasting up to 1.99 MiB at the end of an array instead of just under 4k? Or maybe Linux wouldn't use a hugepage if you only allocated the first couple of 4k pages past a 2M boundary.

            If you're getting the page faults in memset, I assume these arrays aren't sparse and that you are touching every element.

            I believe allocators have a notion of a time window after which application memory is returned to the OS

            It would be possible for an allocator to check the current time every time you call free, but that's expensive so it's unlikely. It's also very unlikely that they use a signal handler or separate thread to do a periodic check of free-list size.

            I think glibc just uses a size-based heuristic that it evaluates on every free. As I said, the man page mentions something about heuristics.

            IMO actually tuning malloc (or finding a different malloc implementation) that's better for your situation should probably be a different question.

            Source https://stackoverflow.com/questions/61737768

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install heaptrack

            You can download it from GitHub.

            Support

            As a FOSS project, we welcome contributions of any form. You can help improve the project by:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Monitoring Libraries

            netdata

            by netdata

            sentry

            by getsentry

            skywalking

            by apache

            osquery

            by osquery

            cat

            by dianping

            Try Top Libraries by KDE

            krita

            by KDEC++

            ghostwriter

            by KDEC++

            kdenlive

            by KDEC++

            latte-dock

            by KDEC++