webservice2: Fix crash for tools with custom memory limits

Change-Id: I6735ea6a9ba9b8362084b111a85d8be2125be51a