Common reasons for giving out include 1) instability from ligament insufficiency or tear, 2) weak muscle from atrophy/weakness/muscle disease etc.
3) pain. After extended running
its possible you are experiencing fatigue which prevents your muscles from properly firing and holding you up. Therefore you must be properly hydrated, conditioned and trained to undergo rigorous running.