I'm using a
Dictionary<StockSymbol, List<CandleData>> _CACHE = new
Dictionary<StockSymbol, List<CandleData>>();
to store data.
I'm using this to keep track of the 'most recent' minute to run subsequent queries. essentially
if (curr.Minute > StockSymbol.LastMinute)
{
List<CandleData> new_candles = GetData(StockSymbol.symbol, StockSymbol.LastMinute,
StockSymbol.LastMinute.AddMinute(30));
if(new_candles.Count>0)
{
_CACHE[StockSymbol.symbol].Value.AddRange(new_candles);
}
}
This works fine when I have small set of keys (FX, Crypto, etc). But when I attempt this with stocks (9900+ keys)-- Eventually it (_CACHE) will have an out of memory exception. I did some research online and it suggests there is a 2GB limit for .NET.. so what is a workaround for this? I have enough RAM on my machine (128gb+).