Zhou,
Unless someone out there is intimately familiar with the exact issue and functions, you are going to have to send this one to NI. Having looked at the code, it looks to me like you have a memory leak. If you have the ability, I would run it, and check your memory resources (if you don't have it, run solitaire, and check the help>>about, this should give you an instant notification of memory availability.) I can't tell off hand where the memory leak is, but it may involve open references that are somehow duplicated in your loop. If all else fails, try monitoring (probe or indicator) your references for changes.
As a work around, you may want to close and reopen your session once in a while.
Good luck