I’m generating a mesh from code. Once I create the mesh it does not get modified; only destroyed and replaced. Should I be calling this function after creating the mesh?
What does it do exactly? Does it immediately upload the data from the RAM to VRAM? Does it clear RAM buffers so as to not waste memory? Isn’t this done automatically?
There’s no way around pure speculation. Even UploadMeshData has already a doc page (however with a typo in the parameter name), it doesn’t have any description and isn’t listed in the docs.
It might be an internal method and might be removed or it might become a documented method in the future. Until then we can just guess what exactly it does. Sometimes a Unity staff member explains some internal stuff in the forum, so you might ask the question there. If you have the time to do some benchmarking / testing feel free to try it out.
As for the clearing of the RAM Unity most likely will keep the mesh data in the RAM, even when it got uploaded to the VRAM. The parameter of “UploadMeshData” suggests that when you pass true to markNoLongerReadable might actually clear the RAM, but again that’s all speculation since we simply don’t know (yet).