Java mechanism to restrict memory and cpu of java sub process