Integrated Modular Avionics (IMA) has been widely used in safety-critical aviation applications over the last 20 years due to its reusability, portability, modularity, and cost-effective re-certification. IMA-based systems effectively manage numerous applications with varying levels of criticality by utilizing shared hardware and middleware supported by hardware-independent APIs like the ARINC 653 standard. Although the ARINC 653 standard provides robust time and memory partitioning, there are significant determinism problems due to shared cache usage in multicore platforms. This issue can be resolved by cache partitioning, allowing applications to run in separate memory regions. This paper proposes a novel cache partitioning technique, called ComCoS, for operating systems with better performance and determinism while preserving safety. In our experiments on an ARINC 653 compatible real-time operating system, our technique provides an average 52% faster performance and 2.91 times lower standard deviation in memory distribution. The ComCoS technique improves 3.48 times in Worst-Case Execution Time (WCET) and reduces the standard deviation by a factor of 6.23 in the memory allocation service.