An exhaust gas cooler for an internal combustion engine, preferably in a motor
vehicle, includes a housing through which exhaust gas can flow in the longitudinal
direction and in which a partition extends in the longitudinal direction and separates
a first chamber from a second chamber. An inlet communicates in the housing with
a first chamber and through which the exhaust gas flows into the housing. An outlet
communicates in the housing at least with the second chamber and via which the
exhaust gas flows out of the housing. The partition has at least one overflow opening
through which the first chamber communicates with the second chamber.