Hi Folks, after a couple of days knocking my head against the wall, I decided to ask for your help.
The issue I am having is a strange memory usage: whenever I create a Texture2D the process memory spikes to 7 Gb and stays at 6Gb. Check this out:
The problem happens both using the Content.Load or trying the Texture2D.FromFile. For example, the following test code always makes the memory usage problem happen:
*for code readability, the map_descriptor.Tile is a Dictionary that maps coordinates to a path (image file). And that is why I use the Path.GetFileNameWithoutExtension when calling the Content Manager.
Please notice I was able to use a few images (for my UI) without any problem. So, being more specific, the issue happens when loading the images I uploaded to this Google Drive. I am creating those Images rendering an SVG with the Magick.Net library, so maybe there is a specific format/encoding that results in such a bug?
A few extra details:
- I already experimented with rendering those tile images in different formats, such as jpg and png, but the problem persisted.
- When adding the tile images to the Content Manager, the resulting XNB files are 1,025 Kb in size, making me believe the images were ok. But, the issue also occurs.
- My map currently has 650 tiles, so I was expecting the process memory to be around 700Mb after I loaded the map… not almost 7Gb O.o
- As maps are created by an editor and support modding, I was planning not to use the Content Manager for map-related assets.
And if you are still reading my long post, thanks a lot!!!