Skip to content

Commit

Permalink
Fix tab/spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Nov 18, 2024
1 parent 3d2577a commit c474ee8
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions native/common/jp_gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ void JPGarbageCollection::init(JPJavaFrame& frame)
_SystemClass = (jclass) frame.NewGlobalRef(frame.FindClass("java/lang/System"));
_gcMethodID = frame.GetStaticMethodID(_SystemClass, "gc", "()V");

jclass ctxt = frame.getContext()->m_ContextClass.get();
_ContextClass = ctxt;
jclass ctxt = frame.getContext()->m_ContextClass.get();
_ContextClass = ctxt;
_totalMemoryID = frame.GetStaticMethodID(ctxt, "getTotalMemory", "()J");
_freeMemoryID = frame.GetStaticMethodID(ctxt, "getFreeMemory", "()J");
_maxMemoryID = frame.GetStaticMethodID(ctxt, "getMaxMemory", "()J");
Expand Down Expand Up @@ -247,21 +247,21 @@ void JPGarbageCollection::onEnd()
if ((Py_ssize_t) pred > (Py_ssize_t) limit)
{
run_gc = 2;
limit = high_water + (high_water>>3) + 8 * (current - last);
}
limit = high_water + (high_water>>3) + 8 * (current - last);
}

#if 0
{
{
JPJavaFrame frame = JPJavaFrame::outer(m_Context);
jlong totalMemory = frame.CallStaticLongMethodA(_ContextClass, _totalMemoryID, nullptr);
jlong freeMemory = frame.CallStaticLongMethodA(_ContextClass, _freeMemoryID, nullptr);
jlong maxMemory = frame.CallStaticLongMethodA(_ContextClass, _maxMemoryID, nullptr);
jlong usedMemory = frame.CallStaticLongMethodA(_ContextClass, _usedMemoryID, nullptr);
jlong heapMemory = frame.CallStaticLongMethodA(_ContextClass, _heapMemoryID, nullptr);
jlong totalMemory = frame.CallStaticLongMethodA(_ContextClass, _totalMemoryID, nullptr);
jlong freeMemory = frame.CallStaticLongMethodA(_ContextClass, _freeMemoryID, nullptr);
jlong maxMemory = frame.CallStaticLongMethodA(_ContextClass, _maxMemoryID, nullptr);
jlong usedMemory = frame.CallStaticLongMethodA(_ContextClass, _usedMemoryID, nullptr);
jlong heapMemory = frame.CallStaticLongMethodA(_ContextClass, _heapMemoryID, nullptr);
printf("consider gc run=%d (current=%ld, low=%ld, high=%ld, limit=%ld) %ld\n", run_gc,
current, low_water, high_water, limit, limit - pred);
printf(" java total=%ld free=%ld max=%ld used=%ld heap=%ld\n", totalMemory, freeMemory, maxMemory, usedMemory, heapMemory);
}
current, low_water, high_water, limit, limit - pred);
printf(" java total=%ld free=%ld max=%ld used=%ld heap=%ld\n", totalMemory, freeMemory, maxMemory, usedMemory, heapMemory);
}
#endif

if (run_gc > 0)
Expand Down

0 comments on commit c474ee8

Please sign in to comment.