> - the following version started using 40M for EXCEL prrocess, keep #APPLICATION ONTIME EXCEL VBA CODE#> That why I had to reduce the code to its simplest form, but this issue > I also found the memory usage increases more if I use more complex code. > or Is that normal? Particularly for the Timer version. > Can you please shed some light on the root cause of this memory behavior? > 12KB every a few seconds, up to 49MB within 4 hours, and keeps growing EXCEL started using 40MB, kept increasing memory usage, added 4KB to > The Timer version uses more memory much faster than OnTime version. > The problem is that I noticed the memory used by EXCEL process will keep #APPLICATION ONTIME EXCEL VBA UPDATE#> Both of them can use C API or COM interface to update a Cell. dna versions here, one uses Timer, another uses OnTime. > OnTime being so unreliable like this in my current VBA implementation. > easily missed when I try to open or save another spreadsheet. For example with OnTime, the timed call can be > works, however Timer seems more reliable since it will *not *be > I've tried and tested timed call by *Timer *and *OnTime*. > below) when I asked you a solution for timed call. > This is more or less a follow up for my old post back in 2011 (see link > On Wednesday, Ap10:05:49 PM UTC-4, JC wrote: > slowly and gets released from time to time. > to the latest one, the same thing is still observed. > I also realized that for some reason I was on an old ExcelDna.xll > memory will be released/freed after certain time. > memory footprint does keep increasing slowly. I profiled the above code quite a bit and confirmed that the * * * * * * * * * * * * * * * * * * * * * * * * * * * *Įnsure that the Excel-DNA project continues by Let us know if you find anything interesting. Reliable in the sense that they will wait until Excel is ready to You can get rid of Application.OnTime by making your own timer andĬalling ExcelAsyncUtil.QueueMacro /. That is not actually involved in your example, and is not likely toĪnother direction you can investigate is to write something similar in NET marshaling code allocates memory outside the. If the problem is with the COM wrappers, I You can try to see whether the memory is from the managed heap, byĪdding some extra GC.Collect() calls, or checking The kind of thing that can be very difficult to track down. Neither of these cases seem to apply to what you are doing, but it is Stack to grow, which could look like a memory leak. * Excel keeps an undo stack, and some actions will cause the undo I have not idea if there is a limit to the memory used in String values, Excel will internally build a table of all the strings * There is some kind of string caching, so if you set a cell to a new Cells(1,1) Range).ĭon't try to release the ExcelDna.Application reference.Įxcel has a few surprising behaviours that can look like memory leaks: Marshal.ReleaseComObject for the four intermediate COM objects youĪccess - ActiveWorkbook. NET COM wrappers being slow to get released. Thanks for posting an update about this issue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |