mirror of
https://github.com/corda/corda.git
synced 2025-01-01 10:46:46 +00:00
fix bug in calculating GC footprint in new heap pool code
This commit is contained in:
parent
00c611fcf9
commit
c6e1644281
@ -114,7 +114,7 @@ killZombies(Thread* t, Thread* o)
|
|||||||
unsigned
|
unsigned
|
||||||
footprint(Thread* t)
|
footprint(Thread* t)
|
||||||
{
|
{
|
||||||
unsigned n = t->heapIndex;
|
unsigned n = t->heapOffset + t->heapIndex;
|
||||||
|
|
||||||
if (t->large) {
|
if (t->large) {
|
||||||
n += extendedSize
|
n += extendedSize
|
||||||
@ -366,6 +366,7 @@ postCollect(Thread* t)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
t->heap = t->defaultHeap;
|
t->heap = t->defaultHeap;
|
||||||
|
t->heapOffset = 0;
|
||||||
t->heapIndex = 0;
|
t->heapIndex = 0;
|
||||||
|
|
||||||
if (t->large) {
|
if (t->large) {
|
||||||
@ -1333,6 +1334,7 @@ Thread::Thread(Machine* m, object javaThread, Thread* parent):
|
|||||||
sp(0),
|
sp(0),
|
||||||
frame(-1),
|
frame(-1),
|
||||||
heapIndex(0),
|
heapIndex(0),
|
||||||
|
heapOffset(0),
|
||||||
protector(0),
|
protector(0),
|
||||||
runnable(this)
|
runnable(this)
|
||||||
#ifdef VM_STRESS
|
#ifdef VM_STRESS
|
||||||
@ -1622,6 +1624,8 @@ allocate2(Thread* t, unsigned sizeInBytes)
|
|||||||
(t->vm->system->tryAllocate(Thread::HeapSizeInBytes));
|
(t->vm->system->tryAllocate(Thread::HeapSizeInBytes));
|
||||||
if (t->heap) {
|
if (t->heap) {
|
||||||
t->vm->heapPool[t->vm->heapPoolIndex++] = t->heap;
|
t->vm->heapPool[t->vm->heapPoolIndex++] = t->heap;
|
||||||
|
t->heapOffset += t->heapIndex;
|
||||||
|
t->heapIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1098,7 +1098,7 @@ class Machine {
|
|||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const unsigned HeapPoolSize = 16;
|
static const unsigned HeapPoolSize = 8;
|
||||||
|
|
||||||
void dispose();
|
void dispose();
|
||||||
|
|
||||||
@ -1223,6 +1223,7 @@ class Thread {
|
|||||||
unsigned sp;
|
unsigned sp;
|
||||||
int frame;
|
int frame;
|
||||||
unsigned heapIndex;
|
unsigned heapIndex;
|
||||||
|
unsigned heapOffset;
|
||||||
Protector* protector;
|
Protector* protector;
|
||||||
Runnable runnable;
|
Runnable runnable;
|
||||||
object* heap;
|
object* heap;
|
||||||
|
Loading…
Reference in New Issue
Block a user