Skip to main content
added 20 characters in body
Source Link

I am working on doing a memory optimization pass on a fully developed game on Unity2021.3.16f1. I am trying to figure out what's the pain point and for that, I need help. Before sharing the profiler I'd like to tell you that game uses the following:

  • Since its a 2.5D shooter game so it uses object pooling pretty extensively
  • All UI elements are mostly POT
  • All textures are compressed
  • The game uses animation instancing for large crowds rendering
  • There is not any major FPS drops and avg FPS is 30 on mid-range devices

Now comes memory. Memory profiler snapshot

Profiler snapshot

These snapshots are just right after game has just started so there's not much action going on. This untracked memory gets piled upto 600mb even if you just wait and do nothing. In Unity editor it gets upto 1.1GB on just launch and if you wait for 3min it goes upto 1.3GB without doing anything.

My first hunch was that there are a lot of objects in Unity's hierarchy due to pooling system so I tried altogether commenting/removing the pooling system which did reduced untracked memory by 100mb less but still I feel like the real culprit is something else that I am not aware of. I did some searches where they say using a lot of scriptable objects could cause this so I do have scriptable objects for level data and I don't think that removing scriptable objects would be a good idea. Any leads would be really helpful.

I also did memory profiling on Android Studio and sharing results:

enter image description here

The following screenshot shows captured heap dump enter image description here

The following screenshot shows record native allocations enter image description here enter image description here

I am working on doing a memory optimization pass on a fully developed game. I am trying to figure out what's the pain point and for that, I need help. Before sharing the profiler I'd like to tell you that game uses the following:

  • Since its a 2.5D shooter game so it uses object pooling pretty extensively
  • All UI elements are mostly POT
  • All textures are compressed
  • The game uses animation instancing for large crowds rendering
  • There is not any major FPS drops and avg FPS is 30 on mid-range devices

Now comes memory. Memory profiler snapshot

Profiler snapshot

These snapshots are just right after game has just started so there's not much action going on. This untracked memory gets piled upto 600mb even if you just wait and do nothing. In Unity editor it gets upto 1.1GB on just launch and if you wait for 3min it goes upto 1.3GB without doing anything.

My first hunch was that there are a lot of objects in Unity's hierarchy due to pooling system so I tried altogether commenting/removing the pooling system which did reduced untracked memory by 100mb less but still I feel like the real culprit is something else that I am not aware of. I did some searches where they say using a lot of scriptable objects could cause this so I do have scriptable objects for level data and I don't think that removing scriptable objects would be a good idea. Any leads would be really helpful.

I also did memory profiling on Android Studio and sharing results:

enter image description here

The following screenshot shows captured heap dump enter image description here

The following screenshot shows record native allocations enter image description here enter image description here

I am working on doing a memory optimization pass on a fully developed game on Unity2021.3.16f1. I am trying to figure out what's the pain point and for that, I need help. Before sharing the profiler I'd like to tell you that game uses the following:

  • Since its a 2.5D shooter game so it uses object pooling pretty extensively
  • All UI elements are mostly POT
  • All textures are compressed
  • The game uses animation instancing for large crowds rendering
  • There is not any major FPS drops and avg FPS is 30 on mid-range devices

Now comes memory. Memory profiler snapshot

Profiler snapshot

These snapshots are just right after game has just started so there's not much action going on. This untracked memory gets piled upto 600mb even if you just wait and do nothing. In Unity editor it gets upto 1.1GB on just launch and if you wait for 3min it goes upto 1.3GB without doing anything.

My first hunch was that there are a lot of objects in Unity's hierarchy due to pooling system so I tried altogether commenting/removing the pooling system which did reduced untracked memory by 100mb less but still I feel like the real culprit is something else that I am not aware of. I did some searches where they say using a lot of scriptable objects could cause this so I do have scriptable objects for level data and I don't think that removing scriptable objects would be a good idea. Any leads would be really helpful.

I also did memory profiling on Android Studio and sharing results:

enter image description here

The following screenshot shows captured heap dump enter image description here

The following screenshot shows record native allocations enter image description here enter image description here

Source Link

Untracked memory in Unity's Profiler

I am working on doing a memory optimization pass on a fully developed game. I am trying to figure out what's the pain point and for that, I need help. Before sharing the profiler I'd like to tell you that game uses the following:

  • Since its a 2.5D shooter game so it uses object pooling pretty extensively
  • All UI elements are mostly POT
  • All textures are compressed
  • The game uses animation instancing for large crowds rendering
  • There is not any major FPS drops and avg FPS is 30 on mid-range devices

Now comes memory. Memory profiler snapshot

Profiler snapshot

These snapshots are just right after game has just started so there's not much action going on. This untracked memory gets piled upto 600mb even if you just wait and do nothing. In Unity editor it gets upto 1.1GB on just launch and if you wait for 3min it goes upto 1.3GB without doing anything.

My first hunch was that there are a lot of objects in Unity's hierarchy due to pooling system so I tried altogether commenting/removing the pooling system which did reduced untracked memory by 100mb less but still I feel like the real culprit is something else that I am not aware of. I did some searches where they say using a lot of scriptable objects could cause this so I do have scriptable objects for level data and I don't think that removing scriptable objects would be a good idea. Any leads would be really helpful.

I also did memory profiling on Android Studio and sharing results:

enter image description here

The following screenshot shows captured heap dump enter image description here

The following screenshot shows record native allocations enter image description here enter image description here