'Save a snapshot of current process to file
Warning: this is not thread safe, do not use with multithread program
Args:
- filename: target file to save snapshot
Returns:
- Bool'

def save_snapshot(self, filename=None):

    if (not filename):
        filename = self.get_config_filename('snapshot')
    snapshot = self.take_snapshot()
    if (not snapshot):
        return False
    fd = open(filename, 'wb')
    pickle.dump(snapshot, fd, pickle.HIGHEST_PROTOCOL)
    fd.close()
    return True
