Attempt to lower the number of resources consumed while running tests

I keep having too many resource issues while running tests, so bit the bullet and try to cleanup a lot. We no longer consume 2k+ threads, but there is still a lot more work to do.

After this PR, we peak around 240 threads (used to be 2-3k)
Would have to change all stop methods to be close. In the long term we
should, rather not in this patch
On Oct 18, 2014 8:46 PM, "Haoyuan Li" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/worker/WorkerClient.java:
>
> > @@ -150,8 +150,11 @@ public synchronized void cacheBlock(long blockId) throws IOException {
> >    @Override
> >    public synchronized void close() {
> >      if (mConnected) {
> > -      mProtocol.getTransport().close();
> > -      mHeartbeatThread.shutdown();
> > +      try {
> > +        mProtocol.getTransport().close();
> > +      } finally {
> > +        mHeartbeatThread.shutdown();
>
> how about using "guava" closable to close these?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/474/files#r19057779>.
>