It depends on where the memory is consumed. Your current question does not contain any information which would allow to estimate, where how much memory is used. You do not even clarify what "used" means - how do you determine this?
Maybe you store huge data arrays in the ApplicationData (see guidata) or accumulate a lot of graphic elements in the figure, instead of updating the existing ones. Without seeing the code, it is impossible to guess the details.