http://grepcode.com/file/repo1.maven.org/maven2/org.apache.pig/pig/0.11.1/org/apache/pig/AccumulatorEvalFunc.java?av=f

My understanding is that cleanup() will be called after getValue() for each invocation of exec().