How to fix javascript and raphaeljs memory leak?
I have the following code usi开发者_StackOverflowng RapahelJs running in IE. This code cause a memory leak and I don't know what is wrong. Does anybody can help me and give some advices in the usage of raphaeljs and memory leaks.
for (i=0; i<2000; i++) {
var r = paper.rect(100, 100, 30, 30);
r.remove();
r = null;
}
Thanks in advance
I received an advice from the rapahels discussion group. I can summarize in one sentence:
Prefer hide/show than remove/create
I can’t see any leakage in given example. Memory does go high, but after time, when GC runs, it goes back to normal. Run the similar example in plain HTML and tell me if you will have a difference.
精彩评论