Developer forum

Forum » Ecommerce - Standard features » System.OutOfMemoryException

System.OutOfMemoryException

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I have a solution based on wrap. Pretty much everything is Wrap code.

I have a rather unusual amount of variants in the form of color options for a house painting producer.

Whenever I try to run TemplateTags in any template, I get the following message:

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Collections.Generic.Dictionary`2.Resize(Int32 newSize, Boolean forceNewHashCodes)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderVariantOption(VariantOption variantOption, Template template, String renderingVariantId)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderVariantOptions(IEnumerable`1 variantOptions, Template parentTemplate, String loopName)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderVariantGroup(Product product, VariantGroup variantGroup, Template template)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderVariantGroups(Product product, Template parentTemplate, String loopName)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Int32 orderLineOfProductCount)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderVariantCombinations(Product product, Template parentTemplate, String loopName)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Int32 orderLineOfProductCount)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProducts(ProductCollection products, Template parentTemplate, String loopName, Int32 loopCounter, Boolean renderRelatedProducts, Boolean renderRelatedLists)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderRelatedProductLists(Template template, RelatedProductListProviderEventArgs relatedParams)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Int32 orderLineOfProductCount)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderLine(OrderLine orderLine, Template template)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderLines(OrderLineCollection orderLines, Template parentTemplate, String loopName)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrderDetails(Template template, Order order, Boolean extendedProperties, OrderTemplateExtenderContext orderContext)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderOrder(Order order, Template template, Boolean extendedProperties, Int32 stepNumber, OrderTemplateExtenderContext orderContext)
   at Dynamicweb.Ecommerce.CustomerCenter.Renderers.MyQuoteRenderer..ctor(CustomerCenterSettings& settings, PageView& pageView, Int32 paragraphId)
   at Dynamicweb.Ecommerce.CustomerCenter.Frontend.GetContent()
   at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)

I have tried the templatetags call in simple pages like order list or quote list where I have just 2 order and none of the order had products with variants.

I understand it is not supposed to work on a product detail page where I have a lot of variants options but how can I get the template tags in other pages?

Is there a performance setting that I am missing?

Thanks,

Adrian

 


Replies

 
Nicolai Pedersen
Reply

A dictionary that runs out of memory... Then you have way too many options. How many?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Quite a lot. I have about 9000 shades (crazy, right?) and most products have alsio another variant group on volume (or packaging). This results in almost 10.000 variant combinations.

In the product Detail page I have solved it with an ajax load of the option based on the first dimension and an Autocomplete on color shades and it works pretty neat.

The problem is I m trying to configure an entire Quote flow with conversion to order and I need to know the available tags for identifying the Quotes that have been converted to Order.

And for that. I tried running the TemplateTags, without any luck. I assumed that the context I was running the TemplateTags in, does not have anything to do with the huge list of variants. For some reason, it looks like it still does.

Any ideeas?

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Do each shade have its own SKU?

Otherwise you should use an orderlinefield instead.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Unfortunately they have different prices, different SKU's and different codes. And on top of that, different volumes.

Variants was the best approach. The problem looks to be they are parsed no matter if I need them or not. I had the same problem with VAriant combinations loop. EVen if I had incluided the loop in an if else condition, the loop is parsed anyway. So I had to switch to rendering the loop with API instead of template tags. It took me a while to realise it was parsed anyway, but eventually I figured it out. 

I don't see this case to be very particular. It is actually pretty standard for this type of business. Probably have not been encountered before in Dynamicweb implementations.

What are my options for TemplateTags()?

Thanks,

Adrian

 

 

You must be logged in to post in the forum