1984 details at length the effectiveness of torture as a tool to control subversion in a totalitarian state (or simply one where rights are not central to governing principles). Here, though, torture is not limited to physical suffering, but also encompasses mind control, brainwashing, and indoctrination. The branch of government that oversees torture at Oceania is ironically named the Ministry of Love. It is, however, effective; through torture, the Ministry is able to transform rebellious minds into loving, accepting ones.
Although Winston is subjected to excruciating physical torture for a prolonged time, his spirit is ultimately broken by the psychological torture he suffers.
Julia betrays Winston easily upon being tortured because she is essentially a survivalist; Winston, on the other hand, does not give up until the very end because he is a natural-born rebel.