Created
April 10, 2019 10:37
-
-
Save ivanbuzyka/791c029fbba47c2c27a337b11d3c11e6 to your computer and use it in GitHub Desktop.
Sitecore sample view layout that contains memory leak code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Threading | |
@using Sitecore.Mvc | |
@using Sitecore.Mvc.Analytics.Extensions | |
@using Sitecore.Mvc.Presentation | |
@model RenderingModel | |
@{ | |
Layout = null; | |
} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>@Html.Sitecore().Field("title", new { DisableWebEdit = true })</title> | |
</head> | |
<body> | |
<h1>@Html.Sitecore().Field("title")</h1> | |
<div> | |
@Html.Sitecore().Placeholder("main") | |
@{ | |
var limit = 9400; | |
for (int i= 0; i < 1000; i++) | |
{ | |
new Thread(() => | |
{ | |
var rnd = new Random(); | |
var list = new List<byte[]>(); | |
for (int j = 0; j < 1000; j++) | |
{ | |
byte[] b = new byte[limit]; | |
b[rnd.Next(0, b.Length)] = byte.MaxValue; | |
list.Add(b); | |
Thread.Sleep(10); | |
} | |
}).Start(); | |
} | |
} | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment