We have updated various sites to version MCV4 and simultaneously we exploited the ability to create Bundle with dll System.Web.Optimization. Everything works.
However, we have the following problem: when javascript is called the bundle of the application allocates about 50 MB RAM, without releasing it. The javascript included in the bundle have are in total about 2 Mb.
Note: We create Bundles in global asax, the event "Application_Start"
protected virtual void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterBundles(BundleTable.Bundles);
RegisterRoutes(RouteTable.Routes);
}
protected virtual void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/content/all.css").Include(
"~/content/site.css"
));
bundles.Add(new StyleBundle("~/content/themes/base/base.all.css").Include(
"~/Content/themes/base/jquery-ui-1.8.23.custom.css",
"~/content/themes/base/kendo.common.css",
"~/content/themes/base/kendo.totalcom.css",
"~/Content/themes/base/jquery.contextmenu.css",
"~/content/themes/base/tipsy.css",
"~/content/themes/base/jquery.ibutton.css"
));
bundles.Add(new ScriptBundle("~/Scripts/all.js").Include(
"~/Scripts/jquery-1.8.2.js",
"~/Scripts/modernizr-1.7.js",
"~/Scripts/jquery-ui-1.8.22.custom.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/jquery.unobtrusive-ajax.js",
"~/Scripts/conditional-validation.js",
"~/Scripts/fileuploader.js",
"~/Content/tiny_mce/jquery.tinymce.js",
"~/Scripts/kendo.all.js",
"~/Scripts/kendo.aspnetmvc.js",
"~/Scripts/jquery.contextmenu.js",
"~/Scripts/jquery.tipsy.js",
"~/Scripts/jquery.checkradio.js",
"~/Scripts/jquery.metadata.js",
"~/Scripts/jquery.ibutton.js",
"~/Scripts/jquery.easing.js",
"~/Scripts/functions.js",
"~/Scripts/Erp.js",
"~/Scripts/Cms.js"
));
}
The bundles are called in the masterpage
<%: Styles.Render("~/Content/all.css") %>
<%: Styles.Render("~/content/themes/base/base.all.css") %>
<%: Scripts.Render("~/Scripts/all.js") %>
EDIT: when the following line is executed an extra 50mb memory is used
<%:
Scripts.Render("~/Scripts/all.js")
%>
Has anyone else has run into this problem? Any suggestions to reduce this memory consumption?