I'm trying to deploy a contract using [Truffle v4.0.1](http://truffleframework.com), within Truffle's own console but I keep getting `out of gas` errors.

The constructor looks like:

```
function MyAwesomeCrowdsale(
    uint64 _startTime,
    uint64 _endTime,
    uint256 _rate,
    uint256 _presaleRate,
    address _wallet,
    address _foundationPool,
    address _foundersPool,
    address _legalExpensesWallet,
    uint256 _goal
) public
{
    require(_endTime > _startTime);
    require(_rate > 0);
    require(_wallet != 0x0);

    token = new MyAwesomeToken(TOTAL_SUPPLY_CAP);
    // mints all tokens and gives them to the crowdsale
    token.mint(address(this), TOTAL_SUPPLY_CAP);
    token.finishMinting();

    startTime = _startTime;
    endTime = _endTime;
    rate = _rate;
    presaleRate = _presaleRate;
    wallet = _wallet;
    goal = _goal;

    vault = new MyAwesomeRefundVault(wallet);

    foundationPool = _foundationPool;
    foundersPool = _foundersPool;
    legalExpensesWallet = _legalExpensesWallet;

    // Set timelocks to 1 year after startTime
    uint64 unlockAt = uint64(startTime + 31622400);
    timelockFounders = new TokenTimelock(token, foundersPool, unlockAt);

    distributeInitialFunds();
}

```

I hit `out of gas` error at the line:

```
timelockFounders = new TokenTimelock(token, foundersPool, unlockAt);

```

`TokenTimelock` is imported from `zeppelin-solidity/contracts/token/TokenTimelock.sol`

If I comment that out then everything deploys just fine, but with that line in there, no amount of messing about with default `gas` and `gasPrice` values helps at all.

How can I reliably estimate the `gas` needed to deploy this contract?