The quote you have highlighted is a perfect example of a metaphor, as it compares the memory of Pi to an ocean where he is bobbing up and down on it. Of course, when we read the entire book, we can see just how appropriate this metaphor is when compared to the actual experience that Pi endures. It also helps us to understand just how expansive Pi's memory is of his life and of the event that did so much to shape it, and it helps us picture Pi's memory as a massive ocean without no end that threatens to overwhelm him at times.
You might find it interesting to examine the quote you highlight in context. Note what comes just before it that helps explain it:
At times he gets a little agitated. It's nothing I say (I say very little). It's his own story that does it.
The metaphor that follows therefore helps describe Pi as he recounts his tale and becomes "agitated" because of the memories that resurface. The metaphor helps us picture how he at times is in danger of becoming overwhelmed by the waters of his past.