Large valley polarization and perpendicular magnetocrystalline anisotropy energy (PMAE) in roomtemperature ferrovalley materials has been pursued for a long time because PMAE not only stabilizes long-range ferromagnetic (FM) order but also ensures spontaneous valley polarization. Herein, valley polarization and MAE of monolayer MX2 (M = Ru, Os; X = Cl, Br) are investigated based on first-principles calculations, Wannier functions, and Monte Carlo simulations. It is found that OsBr2 has a giant valley polarization of 327.158 meV and PMAE of 10.354 meV, ascribing to the strong spin-orbital coupling. The physical mechanism of valley polarization and PMAE are analyzed both qualitatively and quantitatively on the basis of perturbation theory, which shows that the valley polarization induces the distribution of MAE at K and K' valley points with opposite signs, and the couplings between dz2 and dyz, dxz and dxy,and dx2-y2 and dyz in opposite spin channels through orbital angular momentum operator Lx have a dominant contribution to the total MAE. Moreover, doping of a few holes and biaxial compressive strain both remarkably improve the PMAE of OsBr2. Meanwhile, the compressive strain can enhance FM exchange coupling of OsBr2, increasing the Curie temperature Tc far beyond the room temperature. Additionally, doping of a few electrons can significantly increase the PMAE of room-temperature ferrovalley OsCl2 to reach -40 meV. In this paper, we elucidate the physical mechanism of the valley polarization and MAE and indicate that monolayer OsCl2 and OsBr2 are promising for application in valleytronic and magnetic storage devices at room-temperature condition.