Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak with multiple calls #1

Closed
dwachss opened this issue Feb 20, 2015 · 0 comments
Closed

Memory leak with multiple calls #1

dwachss opened this issue Feb 20, 2015 · 0 comments
Labels

Comments

@dwachss
Copy link
Owner

dwachss commented Feb 20, 2015

Hi Danny,
We are using your parsecss. It works great. But there was a memory leak. After calling it around 100 times chrome browser crashes. We looked at the code and observed that global varible munged is increasing the heap memory (700MB) and this causes the chrome browser to crash.
We have reset this varible to empty dictionary in function as follows

$.parsecss = function(e, t) {
var n = {};
e = munge(e).replace(/@(([^;`]|`[^b]|`b[^%])*(`b%)?);?/g, function(e, n) {
processAtRule($.trim(n), t);
return ""
});
$.each(e.split("`b%"), function(e, t) {
t = t.split("%b`");
if (t.length < 2) return;
t[0] = restore(t[0]);
n[t[0]] = $.extend(n[t[0]] || {}, parsedeclarations(t[1]))
});
t(n)
munged = {};
};

It works good now. Let me know if it is OK to reset it.

--Raghavendra Chary

@dwachss dwachss added the bug label Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant