background preloader

Memory_leaks

Facebook Twitter

Choosing innodb_buffer_pool_size | MySQL Performance Blog. November 3, 2007 by Peter Zaitsev39 Comments My last post about Innodb Performance Optimization got a lot of comments choosing proper innodb_buffer_pool_size and indeed I oversimplified things a bit too much, so let me write a bit better description. Innodb Buffer Pool is by far the most important option for Innodb Performance and it must be set correctly.

I’ve seen a lot of clients which came through extreme sufferings leaving it at default value (8M). So if you have dedicated MySQL Box and you’re only using Innodb tables you will want to give all memory you do not need for other needs for Innodb Buffer Pool. This of course assumes your database is large so you need large buffer pool, if not – setting buffer pool a bit larger than your database size will be enough. You also should account for growth of course. You also may choose to set buffer pool as if your database size is already larger than amount of memory you have – so you do not forget to readjust it later.

Wazi " Tutorials " How to Fix Memory Leaks in Java. How to Fix Memory Leaks in Java Your pager hasn't been sleeping well. It periodically wakes you up in the middle of the night to tell you that your server is firing off "OutOfMemoryError" messages. Worse still, your significant other forcibly relocated you to the couch and told you not to return until your pager stops buzzing. Sound familiar? Before You Start Ever heard the story about how Java has "automatic memory management"—you know, the one that someone in marketing upgraded to an epic tale about how you'll never have to worry about memory leaks ever again? Many people believe that black magic and complex tools are required to fix memory leaks. Methodology In this article we'll cover everything from memory leak basics to analyzing heap dumps, so—whether you're an experienced Java developer or encountering Java memory leaks for the first time—you'll be better prepared to deal with memory leaks by the time you reach the conclusion.

What Are Memory Leaks? When is memory eligible for GC? Troubleshooting Memory Leaks - Troubleshooting Guide for Java SE. Handling memory leaks in Java programs. How memory leaks manifest themselves in Java programs Most programmers know that one of the beauties of using a programming language such as Java™ is that they no longer have to worry about allocating and freeing memory. You simply create objects, and Java takes care of removing them when they are no longer needed by the application through a mechanism known as garbage collection. This process means that Java has solved one of the nasty problems that plague other programming languages — the dreaded memory leak.

Or has it? Before we get too deep into our discussion, let’s begin by reviewing how garbage collection actually works. So it is true that Java code does not require the programmer to be responsible for memory management cleanup, and that it automatically garbage collects unused objects. Figure 1. The figure illustrates two classes that have different lifetimes during the execution of a Java application. When are memory leaks a concern? Determining if an application has memory leaks.

Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine. Introduction The Java TM 2 Platform Standard Edition (J2SE TM platform) is used for a wide variety of applications from small applets on desktops to web services on large servers. In the J2SE platform version 1.4.2 there were four garbage collectors from which to choose but without an explicit choice by the user the serial garbage collector was always chosen. In version 5.0 the choice of the collector is based on the class of the machine on which the application is started.

This “smarter choice” of the garbage collector is generally better but is not always the best. When does the choice of a garbage collector matter to the user? Amdahl observed that most workloads cannot be perfectly parallelized; some portion is always sequential and does not benefit from parallelism. The graph below models an ideal system that is perfectly scalable with the exception of garbage collection. The serial collector will be adequate for the majority of applications. Ergonomics for an application. Generations. Terracotta Tech - Cluster Your JVM To Simplify... Object references unsaved transient instance.... Watch out for Hibernate unsaved-value.