Posts

Showing posts with the label Code

High Sitecore memory consumption

Image
Case We experienced a problem last week on a number of servers that steadily kept on using up memory. After inspection it turned out that each and every page request was creating up-to 7 new caches for BlobId's. Since we saw the following in our logs: As you can see, each of these caches took up 500KB and in our case (since 7 caches were created) this resulted in a 3,5MB of consumed memory on the server for each page request. Furthermore, it turned out that these caches were not accessed or used at all but only kept on consuming valuable memory. Find the problem and solution below so you never make the same mistake and don't have to embark on a wild goose-hunt to solve this one. Okay, how did we fix this and what was causing it !? First off, our sincerest thanks to the intervention of Sitecore support which helped us pinpoint the problem directly and made for a quick resolve. Sitecore informed us that the creation of these cache entries is done when a new instan...

Date Ranges in C#

DateRange utility class Throughout development there are a number of typical things that tend to recur. One of these is implementing a means to display start and end dates for News, Events, Symposiums, Lives etc etc Writing a little class that manages printing these dates seemed like a necessary task that just had to be done in order to make this tedious task be a thing of the past. Therefore I created my "DateRange" class (what's in a name) that should handle this entirely for you. The Idea The intriquities of displaying a datetime range should be an abstraction. You should only need to worry about passing the correct dates (start and end - if applicable) to the Utility class combined with an optional formatting. The class can be entirely configured through use of Enumerations for all the separate settings such as DayFormat etc. An additional class was used to implement this utility, the StringValue attribute class. You can easily use thie class to a...

HTML5 & Offline Rocks

Even though I know that the HTML 5 standards and features are slowly becoming old news, there are still a number of features that we haven't incorporated into a lot of projects until now. So after doing some research on the topic of Offline applications and how to use the local storage I set out to build a simple proof of concept. Using the information I found on the following sites : http://www.code-magazine.com/Article.aspx?quickid=1112051 http://www.w3.org/TR/offline-webapps/#offline http://html5demos.com/html5demo.appcache http://www.html5rocks.com/en/tutorials/webdatabase/todo/ I was quickly able to create a simple project that allows for users to register themselves. Registration is then handled by a manager class that does nothing more than append to a file. If you are in offline mode however, the system still allows for the pages to load and to register. Once the internet connection is recovered, the page will synchronize the registrations to the manager...