We have studied the compaction of vapor-deposited amorphous solid water by energetic ions at 40 K. The porosity was characterized by ultraviolet-visible spectroscopy, infrared spectroscopy, and methane adsorption/desorption. These three techniques provide different and complementary views of the structural changes in ice resulting from irradiation. We find that the decrease in internal surface area of the pores, signaled by infrared absorption by dangling bonds, precedes the decrease in the pore volume during irradiation. Our results imply that impacts from cosmic rays can cause compaction in the icy mantles of the interstellar grains, which can explain the absence of dangling bond features in the infrared spectrum of molecular clouds.