2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.profiler
;
12 import org
.apache
.log4j
.Logger
;
14 import com
.yourkit
.api
.Controller
;
16 public class ProfilerController
{
19 private static final Logger logger
= Logger
.getLogger(ProfilerController
.class);
21 private static Controller controller
;
22 private static int memSnapshotCnt
= 0;
24 private static void init(){
25 if(controller
== null){
27 controller
= new Controller();
29 } catch (Exception e
) {
30 logger
.info("The initialization of ProfilerCOntroller fails");
35 public static void memorySnapshot() {
38 logger
.info("taking memory snapshot " + memSnapshotCnt
++);
39 controller
.captureMemorySnapshot();
40 } catch (Exception e
) {
41 logger
.info("taking memory snapshot " + memSnapshotCnt
++ + " fails");