Compiled game size for how many RAM memory used ?

Please share the size of your compiled game and the RAM memory used while the game is running :slight_smile:

Mine : Size : 34 Mb / RAM : 667 000 Kb

I think it is pretty bad for my own and i want to know if it’s related to my code or my assets or to Monogame.

Probably your assets… are you using the heap a lot?

What is the heap ? Can you explai please ?

There is no relation between the two, as it depends on many factors:

  • the number of objects to display,
  • the size of array(s),
  • etc.
    You could have 10Mb of a single model in your assets and with an array of 100000 objects to displayt…
    at best 100000 *10 of RAM occupation without using instancing…

How long have you been coding for!?

How many sound files are you using by the way? are you using .OGG by any chance? this sits in memory uncompressed… unless MG reads it from disk in a stream…

I am guessing a lot of your assets are taking up a lot of memory…

Do you understand how compressed formats work?

I am coding since January 2015. So i’m pretty young in coding world.
For now, no sound files are used (that’s lso why i am looking of answers) and i think Monogame desn’t accept .OGG files.

A bout compressed format :
Before, ine the pipeline tool, i used to define TextureFomat to Color, but i ended with huge .XNB files (whole compiled project compiled was 940 Mb).
Then i changed most of my images (.PNG) to match with DxtCOmpression paramter of TextureFormat (power of 2 dimensions).
And get the 33Mb size for the whole compiled project.

In the end, memory RAM used became 667 000 Kb instead of 1 450 000 Kb with TextureFomat Color setting.
I don’t know if it is related buti am using spritesheets and then i have a lot of transparency in my images.

Can you still share the size / RAM of your project ?

Aside that, i use arrays often in my code.

And what is “heap” ?

The game is like this :

You can use .ogg files in Monogame, in fact, it’s recommended.

My deferred engine Deferred Engine Playground - download

has a compiled size of 510 mb (uncompressed textures and large models) and uses 50mb of RAM. I use all the models and textures in my scene.

weirdly enough it doesn’t go up with higher resolutions, but I guess it’s only VRAM usage that goes up then.

My Car RPG Bounty Road

Has 490mb of data (uncompressed) and uses 170mb of RAM. In both cases I load all models / textures / sounds up front.

As you answered my request I suppose I should be obliged to answer your slightly remarkable request…

You mentioned you use Arrays and it was mentioned above already, but you really should learn how these store information in memory to have an idea of why your application uses XXXXXXX resources… and precisely where it places them too…

Two terms to be aware of, Heap and Stack…

I am not sure how much you will get from that link but it looked relevant, I personally study my languages from books and not the fractured internet… :ramen:

However I am unsure how giving you project sizes will help at all as each project is different… you need to be more specific to make any comparison and also as if It was not obvious already, your coding style will likely be different from another programmer…

I would suggest you took a good look through the MonoGame err documentation and hunt down the Git repository and download it and take a look at any comments found within it and learn what things are supported etc., a quick handy method is to go to the download page, start at the earliest version and read the changelog list… I have done this a number of times just to recall what has changed over the years… and it can help you to understand how something works, IF it is working and the state it is at as well as give you ideas of things you can utilise…, again that Git [I am not a Gitter yet] stuff might interest you as well as you can break into using Dev builds of MonoGame meaning you can use the latest features now… I am not on that sort of level yet, but I am in no rush for that stuff, there is so much more that can be done while waiting for other aspects of your project… each to their own.


My tone may come across as a bit rough or direct but I mean everything in the lightest of ways :slight_smile: I just don’t like to waste time in such places when getting to the point often is more helpful than hopping back and forth…

I will try to look at your link, but i wonder if i will understand it, that seems pretty hardcore.

I didn’t looked at Monogame documentation for a while because it was mostly incomplete and inaccurate for awhile.
about reading the changelog list, it’s the kind o f thing an experienced programmer can dive into easily, but for, it will take months to understand the functionality of every corrections or features.

I understand the use of sincerity and direct tone, but when you said :

[quote=“MrValentine, post:8, topic:8296”]
As you answered my request I suppose I should be obliged to answer your slightly remarkable request…
[/quote], it sounds like “Argh…, Ok, let me show you this thing any idiot know”.
you could have just linked the page, or if searching the page was a pain, just tell me to search “Managing Heap Memory” terms in google.

It is
possible you’ll get angry after reading this but thank you for the link.

Don’t let the English [Not American] language confuse you, I was not implying much… just that The Heap and The Stack are so fundamental… did you not study C# at all? it is something you learn very early in the language… especially surrounding Types and Arrays etc…

I always assume if someone is getting into a language and is remotely able to put anything together, that they at the very least grasp the basics… and Memory Management should be right up there, even if just 10% of it… at least have an idea of it… but you shock me… it asks the question, did you copy the code from somewhere and just change the textures or something? not meaning to offend just it is a deductive approach…

It is like, I give you a car to build but I give you it in parts, the parts make a Honda Civic, but when I come back a week later and you show me a Toyota Prius, somebody is going to ask questions…

Aaaaaaand this forum broke my browser again… yay…

Maybe less “hardcore” and more c#ish :slight_smile::

But be warned that you can’t program a game (something more advanced than a pong like) without knowing the basics, or you will get into frustration many times.
Even a “solitaire”/patience games can drive you crazy ^^

1 Like

I am self-educated and i learn from internet and mostly with these websites :
tutorials-point (c#)

and other devs helping me when facing problems never heard before

Never heard of those…

Try MSDN, StackOverFlow and if you do a web search for similar sites [Search phrase: Sites like MSDN] I am sure you can find more ‘gems’ out there…

I too am self educated in coding :beers: have a drink to that! [Whiskey for me]

As others are saying too [Learn the basics], go grab a simple book on C#, does not have to be expensive, but regardless of the cost, it will be the most valuable book on your book shelf, and you will add more to it as soon as you get hooked…

If you need suggestions of books, just ask… but only ask if you are actually going to buy anything, otherwise you are wasting busy peoples time… we have things to do too… :fork_and_knife:

Channel9 springs to mind, they used to have good videos on coding scenarios such as how to use Async etc.

RBWhitaker does sound familiar actually…

Just to chime in: Use performance diagnostic tools, the integrated Visual Studio tools are pretty good. Check what is using most memory and maybe try to optimize that. Make sure you don’t have a leak and if you don’t have one you are doing fine.

If you aren’t trying to make mobile apps I would suggest you see this as a non-issue right now and try to focus on game content.

1 Like