We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Published website to host - Out of Memory Exception thrown

I finally got my website working on my local system with the MVC Grid in Hierarchical mode! Yay!

However, I have now deployed it to my host's server, and all of my site works except the page with the grid on it! I am getting this execption:

Exception of type 'System.OutOfMemoryException' was thrown.

I have verified that all of the Content folder files and all of the Script folder files are published (at first they weren't).
What  else should I check to make sure everything is there so that it will run properly?

Cindy

6 Replies

CK Cindy Kee April 12, 2016 08:17 AM UTC

After hours of trying to figure out what was missing and what wasn't working on the host's website, I finally discovered that the Syncfusion scripts and styles files could not be bundled in BundleConfig and used on the webpage I need them on. The bundles worked fine on my local system here at home, but on the deployed server at the host's site, the bundles didn't work. Once I added the few files I needed specifically, the page finally loaded.

Incidentally, it was only the Syncfusion scripts and styles that had an issue. My other bundles work fine. I had a bundle that included the jsrender, jquery.easing.., and jquery.globalize, and then the 2 ej.*.js files that I needed, and once I pulled out the ej.*.js files, that bundle worked. Then I added those 2 ej.*.js files to my page without bundling and all was fine. My styles bundle for the grid only included the one style file I wanted to use, but using Fiddler to look at the data on the network, I could see that neither .CSS file referenced by that bundled file could be found. I put the main .CSS file on the page without bundling and it all worked fine.

A very frustrating situation, but at least it is all working now.

Cindy


PK Prasanna Kumar Viswanathan Syncfusion Team April 12, 2016 11:32 AM UTC

Hi Cindy,

Thanks for contacting Syncfusion support.

We checked with the bundled Syncfusion script files and CSS files in sample and its works fine on the IIS host. We did not face any exception while running the sample.


Please find the code example :


  public static void RegisterBundles(BundleCollection bundles)

        {


           ----------------------------------

           bundles.Add(new ScriptBundle("~/Scripts").Include(

                "~/Scripts/ej.web.all.min.js",

                "~/Scripts/ej.unobtrusive.min.js"));

            bundles.Add(new StyleBundle("~/Themes").Include(

                "~/Themes/default-theme/ej.widgets.all.min.css"));
        }


Sample: http://www.syncfusion.com/downloads/support/forum/123684/ze/EJGrid295665063

The mentioned exception occurs due to memory fragmentation. This also occurs when loading huge data to memory stream and your system memory is not capable of storing so much of data. To resolve the issue, we have to clean the temp folder and cache before running the sample.

For more information, refer to the below link,



https://support.microsoft.com/en-in/kb/909678

Please try the attached sample and still if you face any issue, please provide the following details

1.       Code example of BundleConfig.cs file.

2.       Reproduce the issue in the attached sample and send back to us.


3.       Ensure that you have enabled the “EnableOptimizations” in the BundleConfig.cs.  If you enabled the EnableOptimizations, you will face a 404 Error. In ej.widgets.all.min.css” file, we have imported other two CSS files ej.wigets.core.min.css & ej.theme.min.css which is the cause of the issue since importing other files in CSS bundle does not work. So Instead of referring “ej.widgets.all.min.css” file, refer “ej.wigets.core.min.css” && “ej.theme.min.css” files directly in bundling. 


Please refer to the following code example.



[ej.widgets.all.min.css]

@import url("../ej.widgets.core.min.css");

@import url("ej.theme.min.css");

bundles.Add(new StyleBundle("~/Content/css").Include(

...

                 "~/ejThemes/ej.widgets.core.min.css",

                    "~/ejThemes/default-theme/ej.theme.min.css",

                      ...

                      );



               In other way, if you need to refer “ej.widgets.all.min.css” file, then it add as a separate bundle by applying a CssRewriteUrlTransformation in it. Please refer to the following code example.
      


               bundles.Add(new StyleBundle("~/Content/ej").Include(

                     "~/ejThemes/default-theme/ej.widgets.all.min.css"new CssRewriteUrlTransform()

                     ));



Regards,
Prasanna Kumar N.S.V



CK Cindy Kee April 15, 2016 09:35 PM UTC

I'm sorry that I didn't follow up sooner. Thank you for the explanation for this - it's all working now! :)

I really appreciate all of the help you have provided me the last couple of weeks while I worked through using the hierarchical grid! Thank you for the support!

Cindy



ME Megatron April 17, 2016 06:31 PM UTC

Hi, I have an issue where the loading very slow, or in shared web hosting, if there are 10 to 20 users looking at a grid with data, I get memory exception errors. You can also see this in VS 2015 application insights view.

The files are large and since the widgets.all is very large, how do I bundle conditionally to include only Grid or schedule based on what controls there are on the page. for e.g. can I control the bundling in the child or partial views on which scripts load.



thanks



CK Cindy Kee replied to Megatron April 17, 2016 06:35 PM UTC

Hi, I have an issue where the loading very slow, or in shared web hosting, if there are 10 to 20 users looking at a grid with data, I get memory exception errors. You can also see this in VS 2015 application insights view.

The files are large and since the widgets.all is very large, how do I bundle conditionally to include only Grid or schedule based on what controls there are on the page. for e.g. can I control the bundling in the child or partial views on which scripts load.



thanks


And as a follow up to Megatron's post, what are the specific *.js files I need for the Hierarchical Grid so that I can use a smaller set of JavaScript files and not load the ej.web.all.min.js?


PK Prasanna Kumar Viswanathan Syncfusion Team April 18, 2016 09:56 AM UTC

Hi Cindy,

Query :  “How can i use a smaller set of JavaScript files and not load the ej.web.all.min.js?”

We can generate custom scripts for the specified Syncfusion controls using Custom Script Generator, which will reduce the size of script files.

Please refer to the following UG document for Getting Started to Custom Script Generator.


Link : http://help.syncfusion.com/js/custom-script-generator#getting-started-with-custom-script-generator
                                         

Also include the following scripts

<link rel='nofollow' href="Style/ej.widget.default-theme.min.css" rel="stylesheet" />

<script src="scripts/jquery-1.10.2.min.js">script>
<
script src="scripts/jquery.easing-1.3.min.js">script>
<
script src="scripts/jquery.globalize.js">script>
<
script src="scripts/jsrender.min.js">script>
<script src="scripts/ ej.widget.custom.min.js">script> // Downloaded from the Custom script generator

                                                                                                                                                                                                                                     
Refer to the below link to generate custom script.

Link : http://csg.syncfusion.com/

Note : In the Custom Script Generator, we can create a selected theme file.

Regards,
Prasanna Kumar N.S.V


Loader.
Up arrow icon