2978 Rate this article:
No rating

Getting the IDL process identifier on Linux

Mark Alonzo
Atle Borsholm showed me this technique for getting IDL's process identifier (or process id or pid) on Linux (though it should work on any UNIX-based system):
IDL> pid = call_external('libc.so.6', 'getpid')
IDL> print, pid
       22468
I used this recently with pmap to get the memory map of an IDL process; I was curious to see how the OS reported the memory use of IDL plus the shared libraries it uses. For example, SPAWN a call to pmap:
IDL> spawn, 'pmap' + string(pid), pid_memory
IDL> print, ulong((strsplit(pid_memory[-1], /extract))[-1])
      137672
where pmap returns the total memory use in kilobytes, and compare this with the output from MEMORY, scaled to KB:
IDL> print, memory(/current) / 1024
        1029
The difference is that MEMORY (as noted on its Help page) doesn't include memory used by shared libraries.
MOST RECENT

A Technical Dive into Creating Accurate Digital Terrain Models

6/27/2018

Live Webinar | July 25 Creating accurate digital terrain models (DTMs) is essential for modeling areas of... more »

The Science, and Art, of Hyperspectral Image Analysis

6/7/2018

Harris Geospatial Solutions – June 7, 2018 Automation is being touted as the wave of the future for... more »

SIGN UP & STAY INFORMED

Sign up to receive the latest news, events, technologies and special offers.

SIGN ME UP