OutOfMemoryError: Cannot create GC thread. Out of system resources

Scott Carey <sc...@richrelevance.com>
Subject Re: OutOfMemoryError: Cannot create GC thread. Out of system resources
Date Thu, 01 Apr 2010 19:40:54 GMT
The default size of Java's young GC generation is 1/3 of the heap.  (-XX:NewRatio defaults
to 2)
You have told it to use 100MB for in memory file system.  There is a default setting of 64MB
sort space.   

if -Xmx is 128M then the above sums to over 200MB and won't fit.   Turning down the use of
any of the three above could help, or increasing -Xmx.

Additionally, when a thread can't be allocated it could potentially be due to a limit on the
OS side for file system handles per process or user.


On Mar 31, 2010, at 11:48 AM, Edson Ramiro wrote:

> Hi all,
> 
> When I run the pi Hadoop sample I get this error:
> 
> 10/03/31 15:46:13 WARN mapred.JobClient: Error reading task outputhttp://
> h04.ctinfra.ufpr.br:50060/tasklog?plaintext=true&taskid=attempt_201003311545_0001_r_000002_0&filter=stdout
> 10/03/31 15:46:13 WARN mapred.JobClient: Error reading task outputhttp://
> h04.ctinfra.ufpr.br:50060/tasklog?plaintext=true&taskid=attempt_201003311545_0001_r_000002_0&filter=stderr
> 10/03/31 15:46:20 INFO mapred.JobClient: Task Id :
> attempt_201003311545_0001_m_000006_1, Status : FAILED
> java.io.IOException: Task process exit with nonzero status of 134.
>        at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:418)
> 
> May be its because the datanode can't create more threads.
> 
> ramiro@lcpad:~/hadoop-0.20.2$ cat
> logs/userlogs/attempt_201003311457_0001_r_000001_2/stdout
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # java.lang.OutOfMemoryError: Cannot create GC thread. Out of system
> resources.
> #
> #  Internal Error (gcTaskThread.cpp:38), pid=28840, tid=140010745776400
> #  Error: Cannot create GC thread. Out of system resources.
> #
> # JRE version: 6.0_17-b04
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01 mixed mode
> linux-amd64 )
> # An error report file with more information is saved as:
> #
> /var-host/tmp/hadoop-ramiro/mapred/local/taskTracker/jobcache/job_201003311457_0001/attempt_201003311457_0001_r_000001_2/work/hs_err_pid28840.log
> #
> # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> #
> 
> I configured the limits bellow, but I'm still getting the same error.
> 
>  <property>
>  <name>fs.inmemory.size.mb</name>
>  <value>100</value>
>  </property>
> 
>  <property>
>  <name>mapred.child.java.opts</name>
>  <value>-Xmx128M</value>
>  </property>
> 
> Do you know what limit should I configure to fix it?
> 
> Thanks in Advance
> 
> Edson Ramiro

当你在使用PyTorch的CUDA进行深度学习模型训练时,可能会遇到torch.cuda.OutOfMemoryError: CUDA out of memory这个错误。这个错误表示你的显存不足以分配所需的内存空间。 解决这个问题的方法有几种。首先,你可以尝试减小batch_size的大小。通过减小每个batch的样本数量,可以减少显存的压力并降低内存消耗。 另外,你可以使用item()属性来获取torch变量的标量值。使用item()可以释放不必要的内存,从而减少显存的占用。 如果以上方法仍然无法解决问题,你可以尝试设置max_split_size_mb参数来避免内存碎片化。这个参数的作用是在分配内存时进行分割,从而减少内存碎片的产生。你可以查阅PyTorch的文档了解更多关于内存管理的信息。 总之,当遇到torch.cuda.OutOfMemoryError: CUDA out of memory错误时,你可以尝试减小batch_size,使用item()属性获取标量值,以及设置max_split_size_mb参数来解决内存不足的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [报错记录torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB (GPU 0; 7.93 ...](https://blog.csdn.net/gongkeguo/article/details/127674524)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [pytorch: 四种方法解决RuntimeError: CUDA out of memory. Tried to allocate ... MiB](https://blog.csdn.net/xiyou__/article/details/118529350)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [pytorch模型提示超出内存RuntimeError: CUDA out of memory.](https://download.csdn.net/download/weixin_38552305/14884908)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值