You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Large Object Heap - Test with vectors that trigger LOH allocation
Memory-Mapped File Limits - Exhaust virtual memory space
Thread Stack Overflow - Deep recursion in search algorithms
Test Structure
[Test][Category("Stress")][Explicit("Memory pressure test - run manually")]publicasyncTaskDatabase_UnderMemoryPressure_DegradeGracefully(){// ArrangeusingvarmemoryPressureSimulator=newMemoryPressureSimulator();vardatabase=newVectorDatabase();// Populate with moderately large datasetPopulateDatabase(database,vectorCount:50000);// Act: Apply severe memory pressurememoryPressureSimulator.ApplyPressure(MemoryPressureLevel.Severe);varoperations=newList<Task>();// Try various operations under pressureoperations.Add(TestSearchOperations(database));operations.Add(TestIndexBuilding(database));operations.Add(TestVectorAddition(database));varcompletedOperations=0;varfailedOperations=0;foreach(varoperationinoperations){try{awaitoperation.WaitAsync(TimeSpan.FromMinutes(5));completedOperations++;}catch(OutOfMemoryException){failedOperations++;// Expected under severe pressure}}// Assert: Some operations should complete or fail gracefullyAssert.That(completedOperations+failedOperations,Is.EqualTo(operations.Count));Assert.That(database.Count,Is.GreaterThan(0));// Database should remain intact// Relief pressure and verify recoverymemoryPressureSimulator.RelievePressure();GC.Collect();GC.WaitForPendingFinalizers();// Should be able to perform operations normallyvarquery=CreateRandomQuery();varresults=database.Search(query,5,SearchAlgorithm.Linear);Assert.That(results.Count,Is.LessThanOrEqualTo(5));}
Description
Test database behavior under extreme memory pressure and resource constraints to ensure graceful degradation and recovery.
Phase
Phase 2: Large-Scale Stress Testing
Epic
Related to #202
Acceptance Criteria
Memory Pressure Scenarios
Test Structure
Monitoring Tools