The answer is 'it depends', but in general the differences will be minor enough not to be significant.
It's possible a debug build will use extra debugging code which will allocate more objects, but usually this will be an insignificant amount of extra objects.
It's also possible that optimisations in the code will mean that some objects can be garbage collected sooner in release builds, but once again in most cases the effect will be insignificant. In debug builds, local variables are kept around for as long as a method is running so they can be inspected by the debugger but in release builds they may be destroyed early.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Comments
It's possible a debug build will use extra debugging code which will allocate more objects, but usually this will be an insignificant amount of extra objects.
It's also possible that optimisations in the code will mean that some objects can be garbage collected sooner in release builds, but once again in most cases the effect will be insignificant. In debug builds, local variables are kept around for as long as a method is running so they can be inspected by the debugger but in release builds they may be destroyed early.
Software Developer
Red Gate Software Ltd.