首页
登录 | 注册

FAQ: OutOfMemory in WebLogic

FAQ: OutOfMemory in WebLogic

From time to time I see questions like this:

Q: "We are seeing OutOfMemory error in the WebLogic log, after that our app becomes inaccessible. The application is not under heavy load. In fact, we can see it even if the server is idle. WebLogic performance console shows that there is plenty of heap available. What's wrong?".

A: Given the symptoms above, the most likely cause of the problem is that the default size of the heap allocated by JVM for long living objects is often too small for a J2EE application is general and for one under WebLogic in particular. Weblogic uses caching a lot, so if you've got many EJBs, there will be plenty of long living object, and they may not fit into perm heap.

To fix this problem, you need to increase MaxPermSize JVM parameter. Go to WebLogic startup script and add -XMaxPermSize=64m or -XMaxPermSize=128m to JVM startup parameters. If you don't have an application memory leak, this change should take care about the problem.

Q: But how do I know if it's not an app memory leak?

A: The first symptom of the app memory leak is that in addition to OutOfMemory, you will see that the memory graph in WebLogic performance console hits the top, and forcing GC doesn't change anything. Fixing this problem is relatively easy. Get a good profiler tool, like OptimizeIt of JProfiler, and run a load test while memory profiling is enabled. Set up a filter to see only your classes and fined ones taking most of memory. It's likely that the same objects will have largest instance counts.

Tips for setting up a profiler.

First, set the JVM memory to as minimum as possible. If you expect WebLogic to run with 1Gb of JVM heap, set it to much lower values at which app can run. It can be 32M, 64M, depending on the app. Is sounds odd, but the reason is that the memory profiler catches JVM GC activities, and as there will be much more object in 1GB than in 64Mb, that GC under profiler will be dead slow, it can be hours, virtually. Set memory to as low as possible.

Second, turn off anything except the memory profiling. Memory profiling itself is slow, so you will want yo avoid any additional overhead in this case. Performance profiling is to be turned off in any case.

相关文章

  • weblogic安装(静默)
    参考https://jingyan.baidu.com/article/851fbc37acf0013e1e15ab4d.html 基本信息: 1.环境:VMware workstation中新建虚拟机 2.系统:rh6.5 3.安装包:w ...
  • http://blog.csdn.net/yangliuy/article/details/8447886
  • LeaRun.Framework━ .NET快速开发框架 ━ 工作流程组件介绍
    LeaRun.Framework.NET,基于.NET的快速开发框架.整合框架,为企业或个人在.NET环境下快速开发系统提供了强大的支持,开发人员不需要开发系统的基础功能和公共模块,框架自身提供了强大的函数库和开发包,开发人员只须集中精力专 ...
  • 一,安装clamav 根据系统的不同,用不同的命令,yum,pacman等.如果找不到包的话,只有下源码自己编译了. freshclam 三,查看一下clamav进程 四,一些常规用法举例 2,将扫描结果存放到log中,clamscan - ...
  • TOP命令行语义分析
    接触 linux 的人对于 top 命令可能不会陌生(不同系统名字可能不一样,如 IBM 的 aix 中叫 topas ),它的作用主要用来监控系统实时负载率.进程的资源占用率及其它各项系统状态属性是否正常. 下面我们先来看张 top 截图 ...
  • 再谈如何学习Linux,一线Linux专家学习经验谈
    记得最早接触linux是在2000年,那个时候,还在上大学,一个同学从荷兰回来,带回来了一个Linux的拷贝版,记得版本还是Redhat6.2.曾经为安装一个系统让我们忘记疲劳,挑灯夜战,不亦乐乎.那时Linux的学习资料还很少,能够学习的 ...

2020 unjeep.com webmaster#unjeep.com
12 q. 0.012 s.
京ICP备10005923号