Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin' into 1.8.7
  • Loading branch information
brixen committed Jul 8, 2015
2 parents 212718f + 2dcdbb9 commit c107d85
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 49 deletions.
6 changes: 3 additions & 3 deletions vm/gc/baker.cpp
Expand Up @@ -42,7 +42,7 @@ namespace rubinius {
, current(heap_a)
, next(heap_b)
, lifetime_(config.gc_young_lifetime)
, diagnostics_(Diagnostics())
, diagnostics_(Diagnostics(bytes_))
{
reset();
}
Expand All @@ -60,10 +60,10 @@ namespace rubinius {
diagnostics::Diagnostics::log();

utilities::logger::write("baker: diagnostics: " \
"collections: %ld, " \
"collections: %ld, bytes: %ld" \
"10%%: %ld, 20%%: %ld, 30%%: %ld, 40%%: %ld, 50%%: %ld, " \
"60%%: %ld, 70%%: %ld, 80%%: %ld, 90%%: %ld",
collections_,
collections_, bytes_,
occupancy_histo_[0], occupancy_histo_[1], occupancy_histo_[2],
occupancy_histo_[3], occupancy_histo_[4], occupancy_histo_[5],
occupancy_histo_[6], occupancy_histo_[7], occupancy_histo_[8]);
Expand Down
8 changes: 3 additions & 5 deletions vm/gc/baker.hpp
Expand Up @@ -62,11 +62,13 @@ namespace rubinius {
public:
const static int cPercentTiles = 10;

int64_t bytes_;
int64_t collections_;
int64_t occupancy_histo_[cPercentTiles];

Diagnostics()
Diagnostics(unsigned int bytes)
: diagnostics::Diagnostics()
, bytes_(bytes)
, collections_(0)
{
for(int i = 0; i < cPercentTiles; i++) {
Expand Down Expand Up @@ -302,10 +304,6 @@ namespace rubinius {

/// Returns true if the specified object is in the Current space.
bool in_current_p(Object* obj);

double percentage_used() {
return current->percentage_used();
}
};
};

Expand Down
1 change: 0 additions & 1 deletion vm/gc/immix.cpp
Expand Up @@ -64,7 +64,6 @@ namespace rubinius {
: GarbageCollector(om)
, allocator_(gc_.block_allocator())
, marker_(NULL)
, marked_objects_(0)
, chunks_left_(0)
, chunks_before_collection_(10)
, diagnostics_(Diagnostics())
Expand Down
16 changes: 0 additions & 16 deletions vm/gc/immix.hpp
Expand Up @@ -139,7 +139,6 @@ namespace rubinius {

if(obj->marked_p(object_memory_->mark())) return false;
obj->mark(object_memory_, object_memory_->mark());
gc_->inc_marked_objects();

if(push) ms.push_back(addr);
// If this is a young object, let the GC know not to try and mark
Expand All @@ -151,7 +150,6 @@ namespace rubinius {
immix::GC<ObjectDescriber> gc_;
immix::ExpandingAllocator allocator_;
ImmixMarker* marker_;
int marked_objects_;
int chunks_left_;
int chunks_before_collection_;
Diagnostics diagnostics_;
Expand Down Expand Up @@ -180,20 +178,6 @@ namespace rubinius {
return gc_.bytes_allocated();
}

void inc_marked_objects() {
marked_objects_++;
}

int marked_objects() {
return marked_objects_;
}

int clear_marked_objects() {
int m = marked_objects_;
marked_objects_ = 0;
return m;
}

int dec_chunks_left() {
return --chunks_left_;
}
Expand Down
2 changes: 0 additions & 2 deletions vm/metrics.cpp
Expand Up @@ -339,8 +339,6 @@ namespace rubinius {
"memory.young.bytes", metrics_data_.memory.young_bytes));
metrics_map_.push_back(new MetricsItem(
"memory.young.objects", metrics_data_.memory.young_objects));
metrics_map_.push_back(new MetricsItem(
"memory.young.occupancy", metrics_data_.memory.young_occupancy));
metrics_map_.push_back(new MetricsItem(
"memory.immix.bytes", metrics_data_.memory.immix_bytes));
metrics_map_.push_back(new MetricsItem(
Expand Down
3 changes: 0 additions & 3 deletions vm/metrics.hpp
Expand Up @@ -159,7 +159,6 @@ namespace rubinius {
struct MemoryMetrics {
metric young_bytes;
metric young_objects;
metric young_occupancy;
metric immix_bytes;
metric immix_objects;
metric immix_chunks;
Expand All @@ -180,7 +179,6 @@ namespace rubinius {
MemoryMetrics() {
young_bytes = 0;
young_objects = 0;
young_occupancy = 0;
immix_bytes = 0;
immix_objects = 0;
immix_chunks = 0;
Expand All @@ -202,7 +200,6 @@ namespace rubinius {
void add(MemoryMetrics& data) {
young_bytes += data.young_bytes;
young_objects += data.young_objects;
young_occupancy += data.young_occupancy;
immix_bytes += data.immix_bytes;
immix_objects += data.immix_objects;
immix_chunks += data.immix_chunks;
Expand Down
14 changes: 11 additions & 3 deletions vm/object_memory.cpp
Expand Up @@ -44,6 +44,8 @@
#include "instruments/tooling.hpp"
#include "dtrace/dtrace.h"

#include "util/logger.hpp"

// Used by XMALLOC at the bottom
static long gc_malloc_threshold = 0;
static long bytes_until_collection = 0;
Expand All @@ -62,6 +64,15 @@ namespace rubinius {
handles_->diagnostics().log();
code_->diagnostics().log();
symbols_->diagnostics().log();

utilities::logger::write("object memory: diagnostics: total memory: %ld",
baker_->diagnostics().bytes_ +
immix_->diagnostics().bytes_ +
mark_sweep_->diagnostics().bytes_ +
headers_->diagnostics().bytes_ +
handles_->diagnostics().bytes_ +
code_->diagnostics().bytes_ +
symbols_->diagnostics().bytes_);
}

/* ObjectMemory methods */
Expand Down Expand Up @@ -535,9 +546,6 @@ namespace rubinius {
collect_young(state, &gc_data);
#endif
RUBINIUS_GC_END(0);

metrics::MetricsData& metrics = state->vm()->metrics();
metrics.memory.young_occupancy += young_->percentage_used();
}

if(collect_mature_now) {
Expand Down
6 changes: 0 additions & 6 deletions vm/shared_state.cpp
Expand Up @@ -108,12 +108,6 @@ namespace rubinius {
delete internal_threads_;
}

int SharedState::size() {
return sizeof(SharedState) +
sizeof(WorldState) +
symbols.bytes_used();
}

uint32_t SharedState::new_thread_id() {
return atomic::fetch_and_add(&thread_ids_, 1);
}
Expand Down
2 changes: 0 additions & 2 deletions vm/symbol_table.cpp
Expand Up @@ -81,8 +81,6 @@ namespace rubinius {
diagnostics_.bytes_ += bytes;
diagnostics_.modify();

bytes_used_ += bytes;

strings.push_back(str);
kinds.push_back(eUnknown);

Expand Down
8 changes: 1 addition & 7 deletions vm/symbol_table.hpp
Expand Up @@ -71,14 +71,12 @@ namespace rubinius {
SymbolStrings strings;
SymbolKinds kinds;
utilities::thread::SpinLock lock_;
size_t bytes_used_;
Diagnostics diagnostics_;

public:

SymbolTable()
: bytes_used_(0)
, diagnostics_(Diagnostics())
: diagnostics_(Diagnostics())
{
lock_.init();
}
Expand All @@ -87,10 +85,6 @@ namespace rubinius {
return diagnostics_;
}

size_t& bytes_used() {
return bytes_used_;
}

size_t size() {
return symbols.size();
};
Expand Down
1 change: 0 additions & 1 deletion vm/test/test_symbol.hpp
Expand Up @@ -29,6 +29,5 @@ class TestSymbol : public CxxTest::TestSuite, public VMTest {
Array* symbols = Symbol::all_symbols(state);

TS_ASSERT(kind_of<Array>(symbols));
TS_ASSERT(state->shared().symbols.bytes_used() > 0);
}
};

0 comments on commit c107d85

Please sign in to comment.