added flushing of buffer on getting process memory size