相关疑难解决方法(0)

单个.NET进程是否有内存限制

我们目前正在考虑构建一个缓存系统来保存从SQL数据库中提取的数据,并使其可用于其他几个应用程序(网站,Web服务等).我们想象缓存作为Windows服务运行,基本上由一个保存缓存条目的智能字典组成.我的问题是,应用程序的工作集是否有限制(它将在Windows Server 2003下运行)?或者是物理内存量的限制?

.net memory process limit .net-3.5

35
推荐指数
3
解决办法
6万
查看次数

C#List <> Add()方法性能

我正在使用List <>集合,在2个嵌套循环中向集合中添加新对象.在完成循环执行后,集合中添加了大约500000个项目.

首先,添加操作运行良好,但很快就会注意到性能下降,对于最后几千个元素,延迟时间是无法忍受的.

我尝试了各种技巧(初始化具有一定大小的集合--500000),用LinkedList <>集合替换List <>,但它没有太多帮助.

你能给我一个提示来解决这个问题吗?我很有兴趣用更优化的结构更改结构 - 例如LinkedList <>比使用添加等操作更好地执行List <>.

更新列表的方法

   private void UpdateForecastList(ConcurrentDictionary<Int32, RegistroSalidaProductoPrevision> prediccion, bool soloMejoresMetodos = true)
   {
        foreach (KeyValuePair<int, RegistroSalidaProductoPrevision> kvp in prediccion)
        {
            KeyValuePair<int, RegistroSalidaProductoPrevision> localKvp = kvp;

            IList<Prediccion> pExistente = prediccionList.Where(p => p.Id == localKvp.Key).ToList();

            Articulo articulo = (articuloList.Where(a => a.Id == localKvp.Key)).First();

            if (pExistente.Count > 0)
            {
                foreach (var p in pExistente)
                {
                    prediccionList.Remove(p);
                }
            }

            if (kvp.Value.Previsiones.Count > 0)
            {
                var previsiones = kvp.Value.Previsiones.Where(prevision => prevision.Value.LPrevision[1] != null).ToList();
                int previsionesCount = …
Run Code Online (Sandbox Code Playgroud)

c# data-structures

22
推荐指数
5
解决办法
1万
查看次数

标签 统计

.net ×1

.net-3.5 ×1

c# ×1

data-structures ×1

limit ×1

memory ×1

process ×1