fix defects

1. OOME fixed by tail recursive
2. StackOverFlow fixed by tail recursive
3. adding configuration files to enable parallelism
4. adding log configurations