Does the ENVI_SVM_DOIT function have memory leak problem? [message #59510] |
Fri, 28 March 2008 02:43  |
Neve
Messages: 4 Registered: March 2008
|
Junior Member |
|
|
Hi, all. I found that the ENVI_SVM_DOIT function may have memory leak
problem. I used the "Help, /memory" command before and after the
ENVI_SVM_DOIT function was called and found that certain amount memory
lost, even if I remove the image to be classified and training ROIs.
The size of the "lost" memory was different to either that of the
image to be classified or that of the classification result.
It may not be a big issue if one just call the ENVI_SVM_DOIT function
a few times, 'cause the size of "lost" memory is not large. My problem
is that I need to repeatedly use the SVM classifier for around a
thousand times, in which case the memory will finally be consumed and
leads to error.
Could anybody tell me if I am using the ENVI_SVM_DOIT function in a
wrong way or the function has memory leak problem? I also hope that
someone from the ENVI team may see this and solve the problem if it
turns out to be their problem. ; )
I attached my procedure below. The image I used is the one under the
envi\data\ folder.
Pro test
ori_data_path = 'D:\bhtmref'
envi_open_file, ori_data_path, r_fid=ori_img_fid
envi_file_query, ori_img_fid, dims=ori_img_dims, nb=ori_img_nb
numFeatures = ori_img_nb
Feature_Subset = indgen(numFeatures)
Para_C = 100
Para_gamma = 1/numFeatures
out_name = 'D:\clsrst'
envi_restore_rois,'D:\test.roi'
tr_roi_ids = envi_get_roi_ids(fid=fid)
help, /memory
print, '=================='
; Call the svm classification doit routine, using the optimized
parameters
envi_doit, 'envi_svm_doit', $
fid=ori_img_fid, pos=Feature_Subset, dims=ori_img_dims, $
out_name=out_name, roi_ids=tr_roi_ids , $
penalty=Para_C, kernel_gamma= Para_gamma
help, /memory
; Remove the original image and training ROI IDS
envi_file_mng, id=ori_img_fid, /remove
help, /memory
envi_delete_rois, tr_roi_ids
End
|
|
|