Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: Source/platform/heap/Heap.cpp

Issue 1297493002: Oilpan: Remove Heap::s_heapSizePerPersistent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 s_postMarkingCallbackStack = new CallbackStack(); 1927 s_postMarkingCallbackStack = new CallbackStack();
1928 s_globalWeakCallbackStack = new CallbackStack(); 1928 s_globalWeakCallbackStack = new CallbackStack();
1929 s_ephemeronStack = new CallbackStack(); 1929 s_ephemeronStack = new CallbackStack();
1930 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); 1930 s_heapDoesNotContainCache = new HeapDoesNotContainCache();
1931 s_freePagePool = new FreePagePool(); 1931 s_freePagePool = new FreePagePool();
1932 s_orphanedPagePool = new OrphanedPagePool(); 1932 s_orphanedPagePool = new OrphanedPagePool();
1933 s_allocatedSpace = 0; 1933 s_allocatedSpace = 0;
1934 s_allocatedObjectSize = 0; 1934 s_allocatedObjectSize = 0;
1935 s_objectSizeAtLastGC = 0; 1935 s_objectSizeAtLastGC = 0;
1936 s_markedObjectSize = 0; 1936 s_markedObjectSize = 0;
1937 s_markedObjectSizeAtLastCompleteSweep = 0;
1937 s_persistentCount = 0; 1938 s_persistentCount = 0;
1938 s_persistentCountAtLastGC = 0; 1939 s_persistentCountAtLastGC = 0;
1939 s_collectedPersistentCount = 0; 1940 s_collectedPersistentCount = 0;
1940 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); 1941 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages();
1941 // Initially, the total heap size is very small. Thus we'll hit the GC
1942 // condition (i.e., 50% increase on the heap size etc) even if we don't
1943 // take into account the memory usage explained by the collected persistent
1944 // handles. So it is OK to set a large initial value.
1945 s_heapSizePerPersistent = 1024 * 1024;
1946 s_estimatedMarkingTimePerByte = 0.0; 1942 s_estimatedMarkingTimePerByte = 0.0;
1947 1943
1948 GCInfoTable::init(); 1944 GCInfoTable::init();
1949 1945
1950 if (Platform::current() && Platform::current()->currentThread()) 1946 if (Platform::current() && Platform::current()->currentThread())
1951 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide r::instance()); 1947 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide r::instance());
1952 } 1948 }
1953 1949
1954 void Heap::shutdown() 1950 void Heap::shutdown()
1955 { 1951 {
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 observedMaxSizeInMB = sizeInMB; 2393 observedMaxSizeInMB = sizeInMB;
2398 } 2394 }
2399 } 2395 }
2400 2396
2401 void Heap::reportMemoryUsageForTracing() 2397 void Heap::reportMemoryUsageForTracing()
2402 { 2398 {
2403 // These values are divided by 1024 to avoid overflow in practical cases (TR ACE_COUNTER values are 32-bit ints). 2399 // These values are divided by 1024 to avoid overflow in practical cases (TR ACE_COUNTER values are 32-bit ints).
2404 // They are capped to INT_MAX just in case. 2400 // They are capped to INT_MAX just in case.
2405 TRACE_COUNTER1("blink_gc", "Heap::allocatedObjectSizeKB", std::min(Heap::all ocatedObjectSize() / 1024, static_cast<size_t>(INT_MAX))); 2401 TRACE_COUNTER1("blink_gc", "Heap::allocatedObjectSizeKB", std::min(Heap::all ocatedObjectSize() / 1024, static_cast<size_t>(INT_MAX)));
2406 TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeKB", std::min(Heap::marked ObjectSize() / 1024, static_cast<size_t>(INT_MAX))); 2402 TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeKB", std::min(Heap::marked ObjectSize() / 1024, static_cast<size_t>(INT_MAX)));
2403 TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeAtLastCompleteSweepKB", st d::min(Heap::markedObjectSizeAtLastCompleteSweep() / 1024, static_cast<size_t>(I NT_MAX)));
2407 TRACE_COUNTER1("blink_gc", "Heap::allocatedSpaceKB", std::min(Heap::allocate dSpace() / 1024, static_cast<size_t>(INT_MAX))); 2404 TRACE_COUNTER1("blink_gc", "Heap::allocatedSpaceKB", std::min(Heap::allocate dSpace() / 1024, static_cast<size_t>(INT_MAX)));
2408 TRACE_COUNTER1("blink_gc", "Heap::objectSizeAtLastGCKB", std::min(Heap::obje ctSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX))); 2405 TRACE_COUNTER1("blink_gc", "Heap::objectSizeAtLastGCKB", std::min(Heap::obje ctSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX)));
2409 TRACE_COUNTER1("blink_gc", "Heap::persistentCount", std::min(Heap::persisten tCount(), static_cast<size_t>(INT_MAX))); 2406 TRACE_COUNTER1("blink_gc", "Heap::persistentCount", std::min(Heap::persisten tCount(), static_cast<size_t>(INT_MAX)));
2410 TRACE_COUNTER1("blink_gc", "Heap::persistentCountAtLastGC", std::min(Heap::p ersistentCountAtLastGC(), static_cast<size_t>(INT_MAX))); 2407 TRACE_COUNTER1("blink_gc", "Heap::persistentCountAtLastGC", std::min(Heap::p ersistentCountAtLastGC(), static_cast<size_t>(INT_MAX)));
2411 TRACE_COUNTER1("blink_gc", "Heap::collectedPersistentCount", std::min(Heap:: collectedPersistentCount(), static_cast<size_t>(INT_MAX))); 2408 TRACE_COUNTER1("blink_gc", "Heap::collectedPersistentCount", std::min(Heap:: collectedPersistentCount(), static_cast<size_t>(INT_MAX)));
2412 TRACE_COUNTER1("blink_gc", "Heap::heapSizePerPersistent", std::min(Heap::hea pSizePerPersistent(), static_cast<size_t>(INT_MAX)));
2413 TRACE_COUNTER1("blink_gc", "Heap::partitionAllocSizeAtLastGCKB", std::min(He ap::partitionAllocSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX))); 2409 TRACE_COUNTER1("blink_gc", "Heap::partitionAllocSizeAtLastGCKB", std::min(He ap::partitionAllocSizeAtLastGC() / 1024, static_cast<size_t>(INT_MAX)));
2414 TRACE_COUNTER1("blink_gc", "Partitions::totalSizeOfCommittedPagesKB", std::m in(WTF::Partitions::totalSizeOfCommittedPages() / 1024, static_cast<size_t>(INT_ MAX))); 2410 TRACE_COUNTER1("blink_gc", "Partitions::totalSizeOfCommittedPagesKB", std::m in(WTF::Partitions::totalSizeOfCommittedPages() / 1024, static_cast<size_t>(INT_ MAX)));
2415 } 2411 }
2416 2412
2417 size_t Heap::objectPayloadSizeForTesting() 2413 size_t Heap::objectPayloadSizeForTesting()
2418 { 2414 {
2419 size_t objectPayloadSize = 0; 2415 size_t objectPayloadSize = 0;
2420 for (ThreadState* state : ThreadState::attachedThreads()) { 2416 for (ThreadState* state : ThreadState::attachedThreads()) {
2421 state->setGCState(ThreadState::GCRunning); 2417 state->setGCState(ThreadState::GCRunning);
2422 state->makeConsistentForGC(); 2418 state->makeConsistentForGC();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 delete current; 2516 delete current;
2521 } 2517 }
2522 2518
2523 void Heap::resetHeapCounters() 2519 void Heap::resetHeapCounters()
2524 { 2520 {
2525 ASSERT(ThreadState::current()->isInGC()); 2521 ASSERT(ThreadState::current()->isInGC());
2526 2522
2527 Heap::reportMemoryUsageForTracing(); 2523 Heap::reportMemoryUsageForTracing();
2528 2524
2529 s_objectSizeAtLastGC = s_allocatedObjectSize + s_markedObjectSize; 2525 s_objectSizeAtLastGC = s_allocatedObjectSize + s_markedObjectSize;
2526 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages();
2530 s_allocatedObjectSize = 0; 2527 s_allocatedObjectSize = 0;
2531 s_markedObjectSize = 0; 2528 s_markedObjectSize = 0;
2532 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages();
2533 s_persistentCountAtLastGC = s_persistentCount; 2529 s_persistentCountAtLastGC = s_persistentCount;
2534 s_collectedPersistentCount = 0; 2530 s_collectedPersistentCount = 0;
2535 } 2531 }
2536 2532
2537 CallbackStack* Heap::s_markingStack; 2533 CallbackStack* Heap::s_markingStack;
2538 CallbackStack* Heap::s_postMarkingCallbackStack; 2534 CallbackStack* Heap::s_postMarkingCallbackStack;
2539 CallbackStack* Heap::s_globalWeakCallbackStack; 2535 CallbackStack* Heap::s_globalWeakCallbackStack;
2540 CallbackStack* Heap::s_ephemeronStack; 2536 CallbackStack* Heap::s_ephemeronStack;
2541 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; 2537 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
2542 bool Heap::s_shutdownCalled = false; 2538 bool Heap::s_shutdownCalled = false;
2543 FreePagePool* Heap::s_freePagePool; 2539 FreePagePool* Heap::s_freePagePool;
2544 OrphanedPagePool* Heap::s_orphanedPagePool; 2540 OrphanedPagePool* Heap::s_orphanedPagePool;
2545 Heap::RegionTree* Heap::s_regionTree = nullptr; 2541 Heap::RegionTree* Heap::s_regionTree = nullptr;
2546 size_t Heap::s_allocatedSpace = 0; 2542 size_t Heap::s_allocatedSpace = 0;
2547 size_t Heap::s_allocatedObjectSize = 0; 2543 size_t Heap::s_allocatedObjectSize = 0;
2548 size_t Heap::s_objectSizeAtLastGC = 0; 2544 size_t Heap::s_objectSizeAtLastGC = 0;
2549 size_t Heap::s_markedObjectSize = 0; 2545 size_t Heap::s_markedObjectSize = 0;
2546 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0;
2550 size_t Heap::s_persistentCount = 0; 2547 size_t Heap::s_persistentCount = 0;
2551 size_t Heap::s_persistentCountAtLastGC = 0; 2548 size_t Heap::s_persistentCountAtLastGC = 0;
2552 size_t Heap::s_collectedPersistentCount = 0; 2549 size_t Heap::s_collectedPersistentCount = 0;
2553 size_t Heap::s_partitionAllocSizeAtLastGC = 0; 2550 size_t Heap::s_partitionAllocSizeAtLastGC = 0;
2554 size_t Heap::s_heapSizePerPersistent = 0;
2555 double Heap::s_estimatedMarkingTimePerByte = 0.0; 2551 double Heap::s_estimatedMarkingTimePerByte = 0.0;
2556 2552
2557 } // namespace blink 2553 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698