Skip to content

Commit

Permalink
Remove chainbase mlock()
Browse files Browse the repository at this point in the history
The mlock code was effectively inactive until 1.2.4. Enabling it has caused some unexpected support fallout. Remove it for now until a better solution is implemented in the future; performance will effectively be no worse than pre 1.2.4
  • Loading branch information
spoonincode committed Sep 11, 2018
1 parent 315ef1b commit 9a3572c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/chainbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ namespace chainbase {
) );
_segment->find_or_construct< environment_check >( "environment" )();
}

#ifndef _WIN32
if( mlock( _segment->get_address(), _segment->get_size() ) != 0 )
{
//we cannot use fc library here, which means that this message doesn't go to graylog even if you have configure it
//also it doesn't looks as nice as warnings generated by fc
//this message is for 1.0.2 because failing here would be incompatibel with 1.0
//for 1.1 it probably will be changed to throw an exception
std::cerr << "CHAINBASE: Failed to pin chainbase shared memory (of size " << (_segment->get_size() / (1024.0*1024.0))
<< " MB) in RAM. Performance degradation is possible." << std::endl;
}
#endif

abs_path = bfs::absolute( dir / "shared_memory.meta" );

Expand All @@ -147,18 +135,6 @@ namespace chainbase {
_rw_manager = _meta->find_or_construct< read_write_mutex_manager >( "rw_manager" )();
}

#ifndef _WIN32
if( mlock( _meta->get_address(), _meta->get_size() ) != 0 )
{
//we cannot use fc library here, which means that this message doesn't go to graylog even if you have configure it
//also it doesn't looks as nice as warnings generated by fc
//this message is for 1.0.2 because failing here would be incompatibel with 1.0
//for 1.1 it probably will be changed to throw an exception
std::cerr << "CHAINBASE: Failed to pin chainbase metadata memory (of size " << _meta->get_size()
<< " bytes) in RAM. Performance degradation is possible." << std::endl;
}
#endif

bool* db_is_dirty = nullptr;
bool* meta_is_dirty = nullptr;

Expand Down

0 comments on commit 9a3572c

Please sign in to comment.