The late tenth century was a period of prosperity in the Indian Ocean Rim as trade boomed between the song Empire in China, the Cholas in southern India and the Shiite Fatimid caliphate that controlled Egypt and the Red Sea.
The maritime trade between India & China were becoming very lucrative and there were two main routes. The first passed through Straits of Malacca, between the Malay Peninsula & the Sumatra. The Sri Vijaya kingdom controlled this route. The Second more southern route passed through the Sunda straits between Sumatra & Java. Although it was a detour for those going to China or Champa, it had better access to the spice growing Maluka & Banda islands. This route was controlled by the Javans. Not surprisingly there was a constant rivalry between the Sri Vijaya & the Javanese Kingdoms.