when ever we close the file or page the garbage collector runs to clean up the mesh so before that you can write a finalizer method there increment that object value