【问题标题】:Swift/iOS - Massive memory usage attributed to "__StringStorage"?Swift/iOS - 大量内存使用归因于“__StringStorage”?
【发布时间】:2020-06-19 18:02:12
【问题描述】:

我发现我的应用程序使用了大量内存(几乎是一次演出)

我通过生成和导出内存图来分析我的应用程序并运行

heap -s --showSizes my_memgraph.memgraph

我看到数百兆字节归因于 __StringStorage

    COUNT     BYTES       AVG   CLASS_NAME                                       TYPE    BINARY
    =====     =====       ===   ==========                                       ====    ======
       56      3584      64.0   __StringStorage                                  Swift   libswiftCore.dylib
    47279   3782320      80.0   __StringStorage                                  Swift   libswiftCore.dylib
       61      5856      96.0   __StringStorage                                  Swift   libswiftCore.dylib
        6       672     112.0   __StringStorage                                  Swift   libswiftCore.dylib
    21021   2690688     128.0   __StringStorage                                  Swift   libswiftCore.dylib
     1008    145152     144.0   __StringStorage                                  Swift   libswiftCore.dylib
    19030   3044800     160.0   __StringStorage                                  Swift   libswiftCore.dylib
        1       192     192.0   __StringStorage                                  Swift   libswiftCore.dylib
     6000   1536000     256.0   __StringStorage                                  Swift   libswiftCore.dylib
        5     12800    2560.0   __StringStorage                                  Swift   libswiftCore.dylib
     7052 231079936   32768.0   __StringStorage                                  Swift   libswiftCore.dylib
     7000 344064000   49152.0   __StringStorage                                  Swift   libswiftCore.dylib
   292889   4686224      16.0   non-object                                                                 
    92169   2949408      32.0   non-object                                                                 
    54659   2623632      48.0   non-object                                                                 
    72672   4651008      64.0   non-object                    

那是什么,我能做些什么?

【问题讨论】:

    标签: ios swift memory profiling heap-memory


    【解决方案1】:

    我想通了,我在 memgraph gui 中找到了 libswiftCore,然后单击对象发现几乎所有对象都被 GraphQL 保留。

    将 graphQL 缓存策略从 .fetchIgnoringCacheData 更改为 .fetchIgnoringCacheCompletely 让我的问题消失了。

    【讨论】:

      猜你喜欢
      • 2016-06-12
      • 1970-01-01
      • 2015-06-30
      • 2020-05-23
      • 1970-01-01
      • 2018-07-27
      • 2016-04-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多