static int rava_system_memory(lua_State* L) { lua_settop(L, 0); lua_newtable(L); lua_pushinteger(L, uv_get_free_memory()); lua_setfield(L, -2, "free"); lua_pushinteger(L, uv_get_total_memory()); lua_setfield(L, -2, "total"); return 1; }
void jl_gc_init(void) { int szc[N_POOLS] = { 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, 72, 80, 88, 96, //#=18 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 288, 320, 352, 384, 416, 448, 480, 512, 640, 768, 896, 1024, 1536, 2048 }; int i; for(i=0; i < N_POOLS; i++) { norm_pools[i].osize = szc[i]; norm_pools[i].pages = NULL; norm_pools[i].freelist = NULL; ephe_pools[i].osize = szc[i]; ephe_pools[i].pages = NULL; ephe_pools[i].freelist = NULL; } htable_new(&finalizer_table, 0); arraylist_new(&to_finalize, 0); arraylist_new(&preserved_values, 0); arraylist_new(&weak_refs, 0); #ifdef OBJPROFILE htable_new(&obj_counts, 0); #endif #ifdef GC_FINAL_STATS process_t0 = clock_now(); #endif #ifdef _P64 // on a big memory machine, set max_collect_interval to totalmem/ncores/2 size_t maxmem = (uv_get_total_memory()/jl_cpu_cores())/2; if (maxmem > max_collect_interval) max_collect_interval = maxmem; #endif }
/* * Return total amount of memory available in Kbyte. * Doesn't change when memory has been allocated. */ long_u mch_total_mem(int special) { /* We need to return memory in *Kbytes* but uv_get_total_memory() returns the * number of bytes of total memory. */ return uv_get_total_memory() >> 10; }
/* * Class: com_oracle_libuv_LibUV * Method: _getTotalMem * Signature: ()D */ JNIEXPORT jdouble JNICALL Java_com_oracle_libuv_LibUV__1getTotalMem (JNIEnv *env, jclass cls) { return (jdouble) uv_get_total_memory(); }
static PyObject * Util_func_get_total_memory(PyObject *obj) { UNUSED_ARG(obj); return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)uv_get_total_memory()); }
int luv_get_total_memory(lua_State* L) { lua_pushnumber(L, uv_get_total_memory()); return 1; }
static int luv_mem_total(lua_State* L) { lua_pushinteger(L, uv_get_total_memory()); return 1; }