The preheating of intergalactic medium by structure collapsing and ultraviolet background(UVB) are investigated in cosmological hydrodynamical simulations. When gravitational collapsing is the sole heating mechanism, we find that (1) 60%, 45% of the IGM are heated up to S > 8, 17 keV cm 2 respectively at z = 0, but the fractions drop rapidly to a few percents at z = 2; (2) the entropy of the circum-halo gas S cir is higher than the virial entropy for more than 75% of the halos with masses M < 10 11.5 M since z = 2, but the fraction higher than the entropy, S pr , required in preventive model of galaxies formation is only 15−20% for halos with M < 10 10.5 M at z = 0, and decreases as redshift increases; (3)assuming a metallicity of Z ≤ 0.03Z , the fraction of halos whose circum-halo gas having a cooling time longer than the Hubble time t cool,cir > t H is merely 5 − 10% at z 0.5, and even less at z ≥ 1 for halos with M < 10 10.5 M . (4) gas in the filaments undergoes the strongest preheating. Furthermore, we show that the UVB can not enhance the fraction of IGM with S > 17 keV cm 2 , but can increase the fraction of low mass halos(< 10 10.5 M ) that having S cir > S pr to ∼ 70% at z = 0, and that having t cool,cir > t H to 15 − 30% at z 0.5. Our results indicate that preheating due to gravitational collapsing and UVB are inadequate to fulfil the needs of preventative model, especially for halos with 10 10.5 < M < 10 11.5 M . Nevertheless, these two mechanisms might cause large scale galactic conformity.