Patch Set 3: I would prefer that you didn't submit this

(7 inline comments)

I would prefer these checks to be done earlier rather than later, since this feature is mostly a server protection mechanism, e.g. to prevent users from feeding a server with a 1G memory heap objects that are 1.5G in size.