GitPS / Project1

CS 441 Project 1
0 stars 0 forks source link

Fork fails on stress test, probably a memory leak. #6

Closed RyanGittins closed 11 years ago

GitPS commented 11 years ago

Is there a way to reproduce this easily? I ran a pretty decent stress test last night and I didn't see any issues. The only memory issue that I would think could crash the program is when we realloc the array that holds the background jobs. It will always keep getting bigger and bigger with each new job. There is no easy way to fix that,

GitPS commented 11 years ago

It may be a memory issue with the virtual box you are running?

I'm using Ubuntu and I ran the updated stress test with no problem.

Total number of jobs: 1498
Total number of background jobs: 664
phil@phil-U46E:~/Documents/cs441/project1

Edit: ran it about 10 times without issues.

GitPS commented 11 years ago

Possible fix for running out of memory.

https://github.com/GitPS/Project1/commit/7c52fbd6737b373560fcfc0b95c76a2478a20078

GitPS commented 11 years ago

Memory leak fix: https://github.com/GitPS/Project1/commit/5434293e5d8d25a70c18a610c06da76d85fa6ea0

Still looking for more.

RyanGittins commented 11 years ago

Just running ./myshell tests/test2.txt causes an error on fork for me after running for a few seconds. Maybe try running something more stressful on your machine, like ./myshell tests/test2.txt tests/test2.txt tests/test2.txt tests/test2.txt tests/test2.txt.

Been probing for more leaks, having trouble finding anything. It very well could be just my machine and/or Cygwin if you are completely unable to reproduce this one.

GitPS commented 11 years ago

Nothing bad happened.

Total number of jobs: 7490
Total number of background jobs: 3320
phil@phil-U46E:~/Documents/cs441/project1$ 
GitPS commented 11 years ago

Lets call this is "wontfix". I don't see it causing major issues for Prof. Hursey when he tests it. I bet it is Cygwin not being allocated enough memory where as I have 8GB of RAM on my laptop.