IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 16, 2012, 2:39:48 PM (14 years ago)
Author:
bills
Message:

improve measurement of source memory use by counting the child images
which don't have pixels but do have row pointers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSource.c

    r34315 r34318  
    14981498
    14991499// Function to estimate the memory consumed by a source.
    1500 // Not yet complete but it counts the biggest stuff.
    1501 // XXX: handle child images. For big ones the array of data pointers is significant
    1502 #define IMAGE_BYTES(_im, _pix_size) (_im ? (sizeof(psImage) + (_im->numRows * _im->numCols * _pix_size)) : 0)
     1500#define IMAGE_BYTES(_im, _pix_size) (_im ? (sizeof(psImage) + (_im->numRows * sizeof(void*)) + (_im->numRows * _im->numCols * _pix_size * (_im->parent ? 0 : 1))) : 0)
     1501
    15031502#define VECTOR_BYTES(_v, _elem_size) (_v ? (sizeof(psVector) + (_v->n * _elem_size)) : 0)
    15041503
    1505 // estimate the memory consumed by this source
     1504// estimate the memory consumed by this source.
     1505// It doesn't count everything (a couple of psArrays), the big stuff is counted
    15061506psU64 pmSourceMemoryUse (pmSource *source) {
    15071507    psU64 bytes = sizeof(pmSource) + sizeof(pmPeak) + sizeof(pmMoments);
    15081508
     1509    bytes += IMAGE_BYTES(source->pixels, 4);
     1510    bytes += IMAGE_BYTES(source->variance, 4);
    15091511    bytes += IMAGE_BYTES(source->modelVar, 4);
    15101512    bytes += IMAGE_BYTES(source->maskObj, 2);
     1513    bytes += IMAGE_BYTES(source->maskView, 2);
    15111514    bytes += IMAGE_BYTES(source->modelFlux, 4);
    15121515    bytes += IMAGE_BYTES(source->psfImage, 4);
Note: See TracChangeset for help on using the changeset viewer.