OutOfMemory error due to new ThreadPools being made each time AbfsOutputStream is created. Since threadPool aren't limited a lot of data is loaded in buffer and thus it causes OutOfMemory error.
- Limit the number of ThreadCounts while performing hdfs copyFromLocal (Using -t property).
- Reducing OUTPUT_BUFFER_SIZE significantly which would limit the amount of buffer to be loaded in threads.
- Don't create new ThreadPools each time AbfsOutputStream is created and limit the number of ThreadPools each AbfsOutputStream could create.