less memory in java service wrapper