• <small id='QjOzu'></small><noframes id='QjOzu'>

  • <tfoot id='QjOzu'></tfoot>
    • <bdo id='QjOzu'></bdo><ul id='QjOzu'></ul>
    1. <i id='QjOzu'><tr id='QjOzu'><dt id='QjOzu'><q id='QjOzu'><span id='QjOzu'><b id='QjOzu'><form id='QjOzu'><ins id='QjOzu'></ins><ul id='QjOzu'></ul><sub id='QjOzu'></sub></form><legend id='QjOzu'></legend><bdo id='QjOzu'><pre id='QjOzu'><center id='QjOzu'></center></pre></bdo></b><th id='QjOzu'></th></span></q></dt></tr></i><div id='QjOzu'><tfoot id='QjOzu'></tfoot><dl id='QjOzu'><fieldset id='QjOzu'></fieldset></dl></div>

        <legend id='QjOzu'><style id='QjOzu'><dir id='QjOzu'><q id='QjOzu'></q></dir></style></legend>

      1. 序列化为 JSON 时出现 OutOfMemoryException?

        Getting an OutOfMemoryException while serialising to JSON?(序列化为 JSON 时出现 OutOfMemoryException?)
        <legend id='nXNiF'><style id='nXNiF'><dir id='nXNiF'><q id='nXNiF'></q></dir></style></legend>
      2. <small id='nXNiF'></small><noframes id='nXNiF'>

          <tbody id='nXNiF'></tbody>

              • <bdo id='nXNiF'></bdo><ul id='nXNiF'></ul>

                  <tfoot id='nXNiF'></tfoot>
                1. <i id='nXNiF'><tr id='nXNiF'><dt id='nXNiF'><q id='nXNiF'><span id='nXNiF'><b id='nXNiF'><form id='nXNiF'><ins id='nXNiF'></ins><ul id='nXNiF'></ul><sub id='nXNiF'></sub></form><legend id='nXNiF'></legend><bdo id='nXNiF'><pre id='nXNiF'><center id='nXNiF'></center></pre></bdo></b><th id='nXNiF'></th></span></q></dt></tr></i><div id='nXNiF'><tfoot id='nXNiF'></tfoot><dl id='nXNiF'><fieldset id='nXNiF'></fieldset></dl></div>

                2. 本文介绍了序列化为 JSON 时出现 OutOfMemoryException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在序列化,一个MultiDictionary<String,Object>

                  http://powercollections.codeplex.com/到 json .

                  它有 618 个元素,元素被深度嵌套,即单个对象中可能有几个类似字典的对象.我正在使用 JSON.Net

                  It has 618 elements with elements being deeply nested ,i.e. a single Object may have several dictionary like objects in it . I am using JSON.Net

                  String json = JsonConvert.SerializeObject(json, Newtonsoft.Json.Formatting.Indented);
                  

                  我错过了什么?

                  更多信息:-这在我使用动态之前工作正常,我不得不切换到 MultiDictionary 以允许多个同名属性.它适用于大多数情况,只有当项目数量很大时才会中断.

                  MORE INFO: - This was working fine till i was using dynamic , i had to switch to MultiDictionary to allow multiple properties of the same name . It works for most cases , only when the number of items is large , it breaks .

                  更新:-

                  我已经能够控制内存消耗,但减少了一些递归添加到每个元素的元素.

                  I have been able to get a hold of the Memory consumption but cutting down on some elements that were getting added recursively to each element.

                  推荐答案

                  您似乎遇到了 Ciruclar Reference 导致 OutOfMemoryException 或您的对象对您的内存来说太大了.使用 NDepend 进行检查.

                  It appears that you're running into Ciruclar Reference that is causing OutOfMemoryException or your objects are simply too large for your memory. Use NDepend to check this.

                  您可能会发现获取对象的总大小很有用.

                  这篇关于序列化为 JSON 时出现 OutOfMemoryException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)
                  • <bdo id='SydNI'></bdo><ul id='SydNI'></ul>
                    <legend id='SydNI'><style id='SydNI'><dir id='SydNI'><q id='SydNI'></q></dir></style></legend>

                        <tfoot id='SydNI'></tfoot>

                          <tbody id='SydNI'></tbody>
                        <i id='SydNI'><tr id='SydNI'><dt id='SydNI'><q id='SydNI'><span id='SydNI'><b id='SydNI'><form id='SydNI'><ins id='SydNI'></ins><ul id='SydNI'></ul><sub id='SydNI'></sub></form><legend id='SydNI'></legend><bdo id='SydNI'><pre id='SydNI'><center id='SydNI'></center></pre></bdo></b><th id='SydNI'></th></span></q></dt></tr></i><div id='SydNI'><tfoot id='SydNI'></tfoot><dl id='SydNI'><fieldset id='SydNI'></fieldset></dl></div>

                          1. <small id='SydNI'></small><noframes id='SydNI'>