- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 G1GC,jdk 1.7
Java HotSpot(TM) 64-Bit Server VM (24.79-b02) for linux-amd64 JRE (1.7.0_79-b15), built on Apr 10 2015 11:34:48 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 32826020k(12590436k free), swap 33431548k(33358800k free)
CommandLine flags: -XX:AutoBoxCacheMax=3000000 -XX:+DisableExplicitGC
-XX:G1NewSizePercent=20 -XX:+HeapDumpOnOutOfMemoryError -XX:InitialHeapSize=10737418240
-XX:InitiatingHeapOccupancyPercent=70 -XX:MaxDirectMemorySize=1073741824 -XX:MaxGCPauseMillis=1000
-XX:MaxHeapSize=10737418240
-XX:-OmitStackTraceInFastThrow -XX:+PrintGC -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDetails
-XX:+PrintGCTimeStamps -XX:+UnlockExperimentalVMOptions
-XX:+UseCompressedOops -XX:+UseG1GC
大多数次要 GC 工作正常,但它仍然会启动不正常的 fullGC,大约一小时一到两次。
这是一个正常情况的young GC日志
3443.100: [GC pause (young), 0.3021260 secs]
[Parallel Time: 277.6 ms, GC Workers: 4]
[GC Worker Start (ms): Min: 3443100.5, Avg: 3443100.6, Max: 3443100.6, Diff: 0.1]
[Ext Root Scanning (ms): Min: 2.9, Avg: 3.0, Max: 3.1, Diff: 0.2, Sum: 11.9]
[Update RS (ms): Min: 33.5, Avg: 33.6, Max: 33.9, Diff: 0.4, Sum: 134.5]
[Processed Buffers: Min: 180, Avg: 204.8, Max: 227, Diff: 47, Sum: 819]
[Scan RS (ms): Min: 76.0, Avg: 76.2, Max: 76.3, Diff: 0.3, Sum: 304.9]
[Code Root Scanning (ms): Min: 0.0, Avg: 0.1, Max: 0.1, Diff: 0.1, Sum: 0.3]
[Object Copy (ms): Min: 164.4, Avg: 164.4, Max: 164.5, Diff: 0.1, Sum: 657.7]
[Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
[GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.0, Sum: 0.2]
[GC Worker Total (ms): Min: 277.3, Avg: 277.4, Max: 277.4, Diff: 0.1, Sum: 1109.5]
[GC Worker End (ms): Min: 3443377.9, Avg: 3443378.0, Max: 3443378.0, Diff: 0.0]
[Code Root Fixup: 0.2 ms]
[Code Root Migration: 0.3 ms]
[Clear CT: 2.0 ms]
[Other: 22.1 ms]
[Choose CSet: 0.0 ms]
[Ref Proc: 15.7 ms]
[Ref Enq: 0.5 ms]
[Free CSet: 3.2 ms]
[Eden: 5996.0M(5996.0M)->0.0B(5648.0M) Survivors: 148.0M->196.0M Heap: 8934.5M(10.0G)->2997.2M(10.0G)]
[Times: user=1.13 sys=0.00, real=0.30 secs]
这是fullGC之前的异常GC日志。重复了两三遍,也没有清理内存。
3482.422: [GC pause (young) (to-space exhausted), 3.4878580 secs]
[Parallel Time: 1640.5 ms, GC Workers: 4]
[GC Worker Start (ms): Min: 3482421.8, Avg: 3482422.4, Max: 3482424.0, Diff: 2.2]
[Ext Root Scanning (ms): Min: 2.1, Avg: 3.2, Max: 3.8, Diff: 1.7, Sum: 12.6]
[Update RS (ms): Min: 104.8, Avg: 105.2, Max: 105.6, Diff: 0.8, Sum: 421.0]
[Processed Buffers: Min: 201, Avg: 221.2, Max: 236, Diff: 35, Sum: 885]
[Scan RS (ms): Min: 75.1, Avg: 75.2, Max: 75.3, Diff: 0.1, Sum: 300.8]
[Code Root Scanning (ms): Min: 0.0, Avg: 0.1, Max: 0.1, Diff: 0.1, Sum: 0.2]
[Object Copy (ms): Min: 1455.9, Avg: 1456.1, Max: 1456.2, Diff: 0.3, Sum: 5824.2]
[Termination (ms): Min: 0.0, Avg: 0.1, Max: 0.2, Diff: 0.2, Sum: 0.4]
[GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
[GC Worker Total (ms): Min: 1638.2, Avg: 1639.8, Max: 1640.4, Diff: 2.2, Sum: 6559.3]
[GC Worker End (ms): Min: 3484062.2, Avg: 3484062.2, Max: 3484062.2, Diff: 0.0]
[Code Root Fixup: 0.2 ms]
[Code Root Migration: 0.5 ms]
[Clear CT: 2.0 ms]
[Other: 1844.7 ms]
[Choose CSet: 0.0 ms]
[Ref Proc: 60.1 ms]
[Ref Enq: 0.5 ms]
[Free CSet: 1.2 ms]
[Eden: 5648.0M(5648.0M)->0.0B(1876.0M) Survivors: 196.0M->172.0M Heap: 9441.9M(10.0G)->9352.3M(10.0G)]
[Times: user=9.29 sys=0.05, real=3.49 secs]
然后开始了fullGC
3490.812: [Full GC 9626M->1879M(10G), 7.6059670 secs]
[Eden: 0.0B(2048.0M)->0.0B(6144.0M) Survivors: 0.0B->0.0B Heap: 9626.3M(10.0G)->1879.5M(10.0G)], [Perm: 33901K->33901K(36864K)]
[Times: user=10.24 sys=0.00, real=7.61 secs]
为什么最后一次youngGC没有清理任何内存?
最佳答案
从收集开始消息的 to-space exhausted
部分可以看出,您正在遭受撤离失败。
当您的堆上没有足够的可用空间来提升存活或提升的对象(或两者)并且堆无法进一步扩展时,就会发生这种情况。
Monica Beckwith 在 Tips for Tuning the Garbage First Garbage Collector 中写道:
For G1 GC, an evacuation failure is very expensive -
- For successfully copied objects, G1 needs to update the references and the regions have to be tenured.
- For unsuccessfully copied objects, G1 will self-forward them and tenure the regions in place.
往往G1在被迫做这些操作时跟不上分配速度,最终会因为分配失败而被迫进行Full GC。这可能就是为什么在几次疏散失败后您会看到完整的 GC。
Monica 还在 Garbage First Garbage Collector Tuning 中写下了可能的解决方案
Increase the value of the -XX:G1ReservePercent option (and the total heap accordingly) to increase the amount of reserve memory for "to-space".
Start the marking cycle earlier by reducing the -XX:InitiatingHeapOccupancyPercent.
You can also increase the value of the -XX:ConcGCThreads option to increase the number of parallel marking threads.
另外,增加堆是降低疏散失败可能性的另一种选择。
关于java - G1 年轻 GC 不释放内存 - 空间耗尽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30796111/
我们认为 Cloud Foundry 中的一组虚拟机存在 Azure SNAT 耗尽问题。这些机器不经过负载平衡器。 我已经浏览过这份文件: https://learn.microsoft.com/e
我正在使用 onSceneTouchEvent 在 TMX map 上移动玩家: @Override public Scene onCreateScene() { ...
关于这篇文章:Python del Statement , 我最近遇到了以下片段: # custom_process.py import threading import subprocess myL
我有一个具有多个线程的 python 应用程序,其中线程 2 到 n 可能会打开任意数量的文件。我想确保当线程 1 尝试打开文件时,它绝对不会因为文件描述符耗尽而失败。简而言之,我想保留文件描述符而不
我开发了一个 c# .net 4 应用程序,它每天对组织中的每台计算机(超过 70,000 台)执行 WMI 查询。由于与此线程无关的原因,我无法从服务器运行该应用程序,而是从我的 Windows X
我正在尝试在 pytorch 中实现 Yolo-v2。但是,我似乎只是通过网络传递数据而耗尽了内存。该模型很大,如下所示。但是,我觉得我在用我的网络做一些愚蠢的事情(比如不在某处释放内存)。网络在 c
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 9 年前。 Improve this qu
我在这里查看了几个与“太多客户”相关的主题,但仍然无法解决我的问题,所以我必须针对我的具体情况再次询问。 基本上,我设置了本地 Postgres 服务器并需要进行数万次查询,所以我使用了 Python
我正在使用 std::random_device 并想检查它的剩余熵。根据 cppreference.com: std::random_device::entropy double entropy()
我有以下 docker-compos.yml 文件: web: build: . ports: - "4200:4200" - "35729:35729" vo
如果 Linux 操作系统用完进程 ID 会怎样?是否会删除较旧的进程以释放空间以适应 future 的请求? 最佳答案 我假设您问的是达到进程限制时会发生什么。在这种情况下,系统不允许创建新进程,直
我们将 Azure SQL 用作单个数据库并在 DTU 定价模型下使用。我们有一个包含约 50M 条记录的表,我们想在单个字符串属性上添加一个新的非聚集索引。 问题是这是一个生产数据库。如果我使用简单
我们有多个服务总线监听器在应用服务内作为连续的 Azure Webjobs 运行。总共有 12 个监听器 Web 作业在同一个 S1 应用服务计划上运行。环境很小,每天总共大约有~1000-10000
Der Azure 网络专家, 我们的 Web 应用程序经常耗尽出站 TCP 连接。大多数出站连接实际上是 Azure 内部连接(SQL、BlobStore、后端服务)。但我们还没有虚拟网络和专用端点
我下载了一个简单的静态网络服务器的源代码 http://www.ibm.com/developerworks/systems/library/es-nweb/sidefile1.html 但是,我对第
我已经查看了有关 SO 的其他类似问题,但无法很好地将所有内容拼凑在一起。我有一个 Rails 应用程序(在 Heroku 上),它使用具有多进程和多线程的 Puma。我的应用程序还使用 Redis
在此代码中,如果我对 ParseForm() 调用进行注释,请求将按预期工作 package main import ( "fmt" "net/http" "net/url"
我不明白。 XSLX 表大约有 3MB 大,但即使是 1024MB 的 RAM 也不足以让 PHPExcel 将其加载到内存中吗? 我这里可能做错了什么: function ReadXlsxTable
我已配置 CachingConnectionFactory包装了一个 MQTopicConnectionFactory和 MQQueueConnectionFactory每个缓存大小设置为 10。 这
我正在检查 CodeEval 中的一些问题并在 PHP 中遇到这个奇怪的错误。我没有用其他语言遇到过这样的事情,所以我不知道为什么会发生这种情况。不包括整个答案(请不要帮我找到解决方案,除了 PHP
我是一名优秀的程序员,十分优秀!