Well... Seems like MathWorks have confirmed that there is a leak in 2012a. I got the following feedback from tech support today:
"Thank you for the information that you provided. I was able to reproduce this issue at my end in R2012a. It worked absolutely fine in R2012b. It seems to be a known issue in R2012a but not in R2012b with annotation objects and I have forwarded your use case to our Development Team. "
My current findings are so far:
(1) Our 2012a MCR executables (with no figure annotations) => NO LEAKING
(2) Exact same code deployed with 2012b => LEAKING IS BACK (and even worse than before).
I'm not saying that 2012b is the culprit since we are using a privately developed MEX file for interfacing to a MySQL database but I'm basically back to square one and thousands of lines of code to debug :-(
I searched the Matlab bug list but found no relevant info related to leaks in 2012b (and 2012a for that matter). I have asked MathWorks to tell me of other "known issues" (that are not publically available) but I don't think I will get any info.
So... I know this is a long shot.... Do any of you know what to avoid in 2012b in order not to leak memory? ;-)