39 #if defined(__DARWIN__)
42 # include <sys/types.h>
80 vm_abort(
"memory_checked_alloc: calloc failed: out of memory");
94 STATISTICS(maxmemusage.max(memoryusage.get()));
98 #if defined(ENABLE_MEMCHECK)
118 vm_abort(
"mem_realloc: reallocating memoryblock with address NULL, length != 0");
122 #if defined(ENABLE_MEMCHECK)
124 os::memset((
u1*)dst + len2, MEMORY_CLEAR_BYTE, len1 - len2);
127 dst = realloc(src, len2);
130 vm_abort(
"mem_realloc: realloc failed: out of memory");
132 #if defined(ENABLE_MEMCHECK)
134 os::memset((
u1*)dst + len1, MEMORY_CLEAR_BYTE, len2 - len1);
147 log_text(
"returned memoryblock with address NULL, length != 0");
153 #if defined(ENABLE_MEMCHECK)
190 # if 0 && defined(ENABLE_STATISTICS)
195 statistics_print_date();
200 statistics_print_memory_usage();
205 statistics_print_gc_memory_usage();
static void * memset(void *s, int c, size_t n)
#define STATISTICS(x)
Wrapper for statistics only code.
static void * calloc(size_t nmemb, size_t size)
#define STAT_REGISTER_SUBGROUP(var, name, description, group)
Register a statistics group and add it to a group.
int opt_ProfileGCMemoryUsage
static void abort_errno(const char *text,...)
Equal to abort_errnum, but uses errno to get the error number.
int opt_ProfileMemoryUsage
bool threads_thread_start_internal(Utf8String name, functionptr f)
JNIEnv jclass jobject const char * name
static void free(void *ptr)
JNIEnv jthread jobject jclass jlong size
static int mprotect(void *addr, size_t len, int prot)
void memory_mprotect(void *addr, size_t len, int prot)
void vm_abort(const char *text,...)
void * memory_checked_alloc(size_t size)
void mem_free(void *m, int32_t size)
This file contains the statistics framework.
#define STAT_REGISTER_GROUP_VAR(type, var, init, name, description, group)
Register an statistics variable and add it to a group.
FILE * opt_ProfileMemoryUsageGNUPlot
static Utf8String from_utf8(const char *, size_t)
void * mem_realloc(void *src, int32_t len1, int32_t len2)
static void memory_thread(void)
bool memory_start_thread(void)
#define STAT_DECLARE_GROUP(var)
Declare an external group (or subgroup).
void threads_sleep(int64_t millis, int32_t nanos)
void * mem_alloc(int32_t size)