The solubility of gases, like other solubilities, can increase or decrease with temperature. A simple model can be used to explain why gases can behave either way, depending on the gas and the solvent. Solvent molecules attract each other. Pulling them apart to make a cavity will require energy, and heat is absorbed in this step for most solvents. For water, very little heat is required to create pockets that can hold gas molecules.
Energy is released when a gas molecule is popped into the pocket .
Intermolecular attractions between the gas molecule and the surrounding solvent molecules lower its energy, and heat is released. The stronger the attractions are, the more heat is released. Water is capable of forming hydrogen bonds with some gases, while organic solvents often can't. A larger amount of heat is released when a gas molecule is placed in the pocket in water than in organic solvents. There is usually net absorption of heat when gases are dissolved in organic solvents, because the pocket-making contribution is bigger.