I run opencv using this command, or the system crashes, or trying to stop a running process because of lack of memory. My computer has 4GB of memory, of them freely over half.
opencv_traincascade.exe -data haarcascade -vec positives.vec -bg negatives.dat -numStages 16 -minhitrate 0.999 -maxFalseAlarmRate 0.4 -numPos 282 -numNeg 500 -w 119 -h 119 -mode ALL -precalcValBufSize 512 -precalcIdxBufSize 512