We should only create the attachments Record on a Delivery if it actually gets used.
When the Reactor bits were added in 0.10 via
PROTON-881, all of the main engine objects were made to implement the 'Extendable' interface that gave them an 'attachments' 'Record' that can be used to store things, by default seemingly just details relating to the Handler heirarchy as used by the Reactor.
In the case of the Delivery objects this currently means every message sent or received by the engine creates a RecordImpl object (which in turn holds a HashMap). This happens regardless of whether the Reactor is even being used, and whether there are any attachments being set/checked on the Delivery. Even when the Reactor is being used, by default the lowest level the Handlers seem to get looked up when process is called is at the Link level (then Session, then Connection, etc) meaning its likely the Delivery attachments will never be used unless by the application code.