How to extract data/code proces memory info with qnx_psinfo

Hello to all .

I have problem with memory leaking , and want to make monitor
proces to supervise my system .
But , I have problem with obviosly misunderstanding qnx_psinfo , and
qnx_segment_info
functions .

My first approuch was to use qnx_psinfo , and obtain _psinfo , and _seginfo
data .

  1. When I call qnx_psinfo(PROC_PID,pid, &psdata,sindex,segdata) , and sindex
    = 0
    I think that in segdata structure must be up to 16 _seginfo structures
    for process pid .

From this I can extract data about data memory ( malloced memory from
heap ) ,
I suppose ?
Next , I need to go from index 0 to index 15 in segdata , and try to
extract info .
_PPF_INUSE & flags = 0 mean that segment is not in use , right ?

But , there is problem ! I looked at flags _PMF_DATA_RW and _PMF_DATA_R
,
and that is not enough !?

QUESTION : How to obtain info about data memory , i.e. what to do with
_seginfo flags info ?

  1. I read something about that is better to do things like this by
    qnx_segment_info ,
    is it true ?

  2. What mean _psinfo.nselector ? Does it mean how many segments have
    process ?
    And if this is true , which connection is between nselector and segdata
    _seginfo[16] )
    structure ? Is nselector ending index in segdata structure ?


    I hope that someone will answer on this , it is urgent …

Thanks in advance ,

Nikola Popovic

“Nikola Popovic” <pnikola@ptt.yu> wrote in message
news:a0nt3s$611$1@inn.qnx.com

Hello to all .

I have problem with memory leaking , and want to make monitor
proces to supervise my system .
But , I have problem with obviosly misunderstanding qnx_psinfo , and
qnx_segment_info
functions .

For memory leak issue, from my experience it’s better to use heap* familly
of function.

While not a complete answer, you could take a look at “sysmon”
at www.parse.com in the free software section. It has some of
the things you’re looking for…

Cheers,
-RK

Nikola Popovic <pnikola@ptt.yu> wrote:

Hello to all .

I have problem with memory leaking , and want to make monitor
proces to supervise my system .
But , I have problem with obviosly misunderstanding qnx_psinfo , and
qnx_segment_info
functions .

My first approuch was to use qnx_psinfo , and obtain _psinfo , and _seginfo
data .

  1. When I call qnx_psinfo(PROC_PID,pid, &psdata,sindex,segdata) , and sindex
    = 0
    I think that in segdata structure must be up to 16 _seginfo structures
    for process pid .

From this I can extract data about data memory ( malloced memory from
heap ) ,
I suppose ?
Next , I need to go from index 0 to index 15 in segdata , and try to
extract info .
_PPF_INUSE & flags = 0 mean that segment is not in use , right ?

But , there is problem ! I looked at flags _PMF_DATA_RW and _PMF_DATA_R
,
and that is not enough !?

QUESTION : How to obtain info about data memory , i.e. what to do with
_seginfo flags info ?

  1. I read something about that is better to do things like this by
    qnx_segment_info ,
    is it true ?

  2. What mean _psinfo.nselector ? Does it mean how many segments have
    process ?
    And if this is true , which connection is between nselector and segdata
    _seginfo[16] )
    structure ? Is nselector ending index in segdata structure ?



    I hope that someone will answer on this , it is urgent …

Thanks in advance ,

Nikola Popovic



Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Consulting and Training at www.parse.com
Email my initials at parse dot com.