mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8187685: NMT: Tracking compiler memory usage of thread's resource area
Bias compiler thread's resource area to mtCompiler Reviewed-by: kvn, coleenp
This commit is contained in:
parent
3ccd60110d
commit
0d8679e178
3 changed files with 18 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -27,6 +27,15 @@
|
||||||
#include "memory/resourceArea.hpp"
|
#include "memory/resourceArea.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
|
|
||||||
|
void ResourceArea::bias_to(MEMFLAGS new_flags) {
|
||||||
|
if (new_flags != _flags) {
|
||||||
|
MemTracker::record_arena_free(_flags);
|
||||||
|
MemTracker::record_new_arena(new_flags);
|
||||||
|
_flags = new_flags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------ResourceMark-----------------------------------
|
//------------------------------ResourceMark-----------------------------------
|
||||||
debug_only(int ResourceArea::_warned;) // to suppress multiple warnings
|
debug_only(int ResourceArea::_warned;) // to suppress multiple warnings
|
||||||
|
|
|
@ -70,7 +70,11 @@ public:
|
||||||
return (char*)Amalloc(size, alloc_failmode);
|
return (char*)Amalloc(size, alloc_failmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_only(int nesting() const { return _nesting; });
|
// Bias this resource area to specific memory type
|
||||||
|
// (by default, ResourceArea is tagged as mtThread, per-thread general purpose storage)
|
||||||
|
void bias_to(MEMFLAGS flags);
|
||||||
|
|
||||||
|
debug_only(int nesting() const { return _nesting; })
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3263,6 +3263,9 @@ CompilerThread::CompilerThread(CompileQueue* queue,
|
||||||
_buffer_blob = NULL;
|
_buffer_blob = NULL;
|
||||||
_compiler = NULL;
|
_compiler = NULL;
|
||||||
|
|
||||||
|
// Compiler uses resource area for compilation, let's bias it to mtCompiler
|
||||||
|
resource_area()->bias_to(mtCompiler);
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
_ideal_graph_printer = NULL;
|
_ideal_graph_printer = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue