Skip to content

Instantly share code, notes, and snippets.

@lanwin
Created October 28, 2012 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanwin/3968193 to your computer and use it in GitHub Desktop.
Save lanwin/3968193 to your computer and use it in GitHub Desktop.
Raven Client 1.2.2127 OOM on inserting large amounts of data
public class OutOfMemoryTest
{
public void Run()
{
// client version 1.2.2127
using(var store = new DocumentStore
{
Url = "http://TestRaven:8080",
DefaultDatabase = "Test",
})
{
LogManager.DisableLogging();
store.Initialize();
store.Conventions.ShouldCacheRequest = url => false;
store.MaxNumberOfCachedRequests = 0;
store.EnlistInDistributedTransactions = false;
using(store.DisableAggressiveCaching())
{
while(true)
using(var session = store.OpenSession())
{
for(var i = 0; i < 1000; i++)
session.Store(new Article {Text = "foobar"});
session.SaveChanges();
}
}
}
}
public class Article
{
public string Text { get; set; }
}
}
@lanwin
Copy link
Author

lanwin commented Oct 28, 2012

The memory pressure should be on a constant level because the session is disposed after a batch of 1000 items. But the memory grows and grows until it gets into OOM.

@ayende
Copy link

ayende commented Oct 28, 2012

What happens when you disable profiling?

@ayende
Copy link

ayende commented Nov 1, 2012

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment