Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Heap Allocation/Deallocation Statistics On QNX 7.0: Page 1 of 13 (13 Items)
   
Heap Allocation/Deallocation Statistics On QNX 7.0  
Hey all, thanks for taking the time to read through.

My problem is the following: 
I have a QNX process that I've created that keeps track of some system performance statistics such as CPU usage for 
various processes, threads, etc. I'd also like to keep track of the number of heap allocations/deallocations that are 
used within different system processes (ie calls to malloc, free, etc); and I'd like to do this programatically, either 
by means of ioctl/devct or any other means you can think of. I'm currently looking into the following devctl commands:

devctl(fd, DCMD_PROC_MAPINFO, mbuffers, sizeof(mbuffers), &num_segments);
devctl(fd, DCMD_PROC_PAGEDATA, mbuffers, sizeof(mbuffers), &num_segments);

which return some number of memory segments associated with the process, including stack, data, shared object memory 
spaces, etc. 

I'm not sure if this is the correct approach, and any help/guidance is greatly appreciated. For some more context I am 
using QNX 7.0