Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSTest Out of memory exception

Im having some problems running a test that creates a very large byte array (~4GB).

When i run it on a release/debug mode, everything works great, but when i run a test which initializes this array, i get OutOfMemory exception

for (int i = 0; i < 56000; i++)
{
    m_BlocksFree.Enqueue(new byte[65536]);
}

At first i thought since i have alot of tests that initialize this big array then i get an out of memory exception, but even when running a single test i get the same exception.

Im writing in C# & working with MSTest, Rhinomocks and structureMap, win7 64bit.

Thanks for the helpers :)

like image 648
Moshe Derri Avatar asked Mar 24 '23 14:03

Moshe Derri


1 Answers

Found the issue...

The test used QTAgent32 (32bit) and not QTAgent (64bit).

The solution was to select "Run tests in 64 bit process on 64 bit machine" in testsettings (under Host).

like image 116
Moshe Derri Avatar answered Apr 07 '23 05:04

Moshe Derri