Magic value for NUM_MISSIONS_SUPPORTED in navigation.h explanation

navigation.h defines NUM_MISSIONS_SUPPORTED as 500.

Would it be possible to elaborate on the reasoning behind the 500 mission item limitation and how we can go about calculating a suitable upper limit for mission items if we were to recompile PX4? For PX4_POSIX systems it is defined as UINT16_MAX-1, which makes sense as it is the addressable limit, similarly memory constrained systems are specifically set to 50.

Both the Cube Orange and the Pixhawk 6X limits the amount of waypoints to 500.

From my understanding dataman provides persistent storage and can be configured to use the SD Card (System ยท PX4 Developer Guide). Dataman in the above controllers always initialises its respective file to 62,560 bytes irrespective of the SD Card size but I cannot find additional documentation if the file size is a directly influenced by the mission number limitation as specified above, or if there are additional caching limitations related to ram size.

Any help or additional documentation would be appreciated.

You should be able to raise that limit. If I remember right it was chosen and then tested but more might work just fine.