We wrote our own custom P4CommandResult to work around this. The issue we were having was that for large result sets we were already filtering the results and updating our own data structures using the TaggedObject callbacks. The issue is that a great deal of memory is allocated after the command runs to populate the TaggedObjects in the P4CommandResult because it must serialize all the data from unmanaged results in C++ to a dictionary per result in C#. All that is needed is a flag on the results class to disable this serialization (for Tagged, Info, Binary, etc.)
We wrote our own custom P4CommandResult to work around this. The issue we were having was that for large result sets we were already filtering the results and updating our own data structures using the TaggedObject callbacks. The issue is that a great deal of memory is allocated after the command runs to populate the TaggedObjects in the P4CommandResult because it must serialize all the data from unmanaged results in C++ to a dictionary per result in C#. All that is needed is a flag on the results class to disable this serialization (for Tagged, Info, Binary, etc.)