A classical problem of stochastic simulation is how to estimate the variance of the sample mean from dependent but stationary outputs. Traditional estimators of the variance of the sample mean require specification of the simulation run length a priori. To our knowledge, the dynamic non-overlapping batch means (DNBM) and dynamic partial overlapping batch means (DPBM) are the only two existing variance estimators without assuming that the simulation run length (data size) is known in advance. Obtaining good estimators of the variance of the sample mean without assuming that the data size is known in advance is the primary motivation of the author's dissertation research. The research encompasses five areas: 1. The creation of improving the DPBMin terms of the storage space. 2. The creation of proposing the 100(1−w−1)%DOBM, which is a generalization of DNBM and DPBM. 3. The creation of obtaining finite-memory algorithms to extend DPBM algorithm to reflect the correlation structure of the data. 4. The investigation of developing MSE-optimalDPBM algorithms to estimate the variance of the sample via estimating the optimal batch size of the estimator. 5. In addition, we apply simulation to study a physical examination service to improve the system efficiency.