PDA

View Full Version : string in tight loops



anon10320
04-04-2013, 09:21 PM
Sir,
I's doing += operation in tight loop and have run the program by using time command 'time ./myapp' but when the program gets executed it shows "killed" at the end of execution .sir, why it is killed ?

611612

Thanks
anon10320

anup
04-04-2013, 09:26 PM
Anon10320,

If you run your program from within GDB, it will tell you exactly why it was killed.

Thanks,

Anup

anon10320
05-04-2013, 12:42 AM
Sir,
I've used gdb ,it shows that program killed by signal SIGKILL. Sir, why SIGKILL is killing my program .I've no any idea about SIGKILL and please tell me when it kills the program .
614615

Thanks
anon10320

anup
05-04-2013, 06:18 AM
Anon10320,

If your program consumes too many resources the VM-Monitor kills it, that is what could be happening.

Thanks,

Anup

anon10320
05-04-2013, 07:13 PM
Sir,
In this case,if program is killed then how one can do profiling of particular program ,I mean gmon.out is not created when I run it.
>g++ -g myapp.cpp -o myapp -pg
>./myapp
>ls
myapp.o myapp.cpp myapp

Thanks
anon10320

anup
05-04-2013, 09:22 PM
Anon10320,

I took a relook at your program, it appears that you are going out of memory as you are doing a += on one string.

Thanks,

Anup