That you need to unmount swap (and change the overcommit memory setting) is a given, even for soft-real-time.
Hard realtime linux systems do that as a basic given, and all real-time code I've ever seen was C, C++ or SmallTalk, and effectively bypasses the kernel entirely.