/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_SERVICES_MEMORYPOOL_HPP
#define SHARE_VM_SERVICES_MEMORYPOOL_HPP
#include "gc_implementation/shared/mutableSpace.hpp"
#include "memory/defNewGeneration.hpp"
#include "services/memoryUsage.hpp"
#ifndef SERIALGC
#endif
// A memory pool represents the memory area that the VM manages.
// The Java virtual machine has at least one memory pool
// and it may create or remove memory pools during execution.
// A memory pool can belong to the heap or the non-heap memory.
// A Java virtual machine may also have memory pools belonging to
// both heap and non-heap memory.
// Forward declaration
class MemoryManager;
class SensorInfo;
class Generation;
class DefNewGeneration;
class PSPermGen;
class PermGen;
class ThresholdSupport;
friend class MemoryManager;
public:
enum PoolType {
};
private:
enum {
};
// We could make some of the following as performance counters
// for external monitoring.
const char* _name;
int _num_managers;
public:
MemoryPool(const char* name,
bool support_usage_threshold,
bool support_gc_threshold);
// max size could be changed
return prev;
}
}
// Records current memory usage if it's a peak usage
void record_peak_memory_usage();
// check current memory usage first and then return peak usage
return _peak_usage;
}
void reset_peak_memory_usage() {
}
void set_usage_sensor_obj(instanceHandle s);
void set_gc_usage_sensor_obj(instanceHandle s);
virtual MemoryUsage get_memory_usage() = 0;
virtual size_t used_in_bytes() = 0;
virtual bool is_collected_pool() { return false; }
// GC support
void oops_do(OopClosure* f);
};
public:
CollectedMemoryPool(const char* name, PoolType type, size_t init_size, size_t max_size, bool support_usage_threshold) :
bool is_collected_pool() { return true; }
};
private:
public:
ContiguousSpacePool(ContiguousSpace* space, const char* name, PoolType type, size_t max_size, bool support_usage_threshold);
};
private:
public:
const char* name,
bool support_usage_threshold);
}
}
};
#ifndef SERIALGC
private:
public:
const char* name,
bool support_usage_threshold);
};
#endif // SERIALGC
private:
public:
};
private:
public:
};
#endif // SHARE_VM_SERVICES_MEMORYPOOL_HPP