Both those methods affect dynamically the php settings thus altering whatever is set in the php.ini. However those changes go away once the script finishes it's task so just leave it as is. No cleanup is required.
General developer forum
Raising and lowering memory
This discussion has been locked so you can no longer reply to it.