Questions tagged [memory]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

SFML Tilemap VertexArray memory not assigned error

I'm trying to make an SFML tilemap. Here's the code (I reconstructed a minimal code example to reproduce the error) Source.h ...
0
votes
2answers
99 views

Disposing objects when changing screens

I'm making my first game with LibGDX and Box2D, and I've realized that the memory used increases when I change screens. It starts from 150MB and progressively reaches 850. How should I deal with this? ...
0
votes
1answer
28 views

In unity i have this code that has to make a lot of allocation but no new variables are creates, but still the RAM usage just keeps climbing

So I have this code that has four for-loops inside each other, so there are a lot of actions, but no new Space should be needed. Still, when trying to run this, Unity stops responding and in the Task-...
3
votes
1answer
150 views

How do open world game engines allocate memory?

My troubles I've been trying to create a game engine but since I am not well experienced in C++ I am having trouble deciding on how to load new scenes efficiently level by level or just an open world....
0
votes
1answer
44 views

How do I download audio resources and save them in cache?

I am developing a game in Unity3d 2019, the instructions of the game must be translated into several languages. Right now, they are part of the compilation, but this makes the compilation very large. ...
3
votes
2answers
217 views

String storage in game engine

I've been designing the memory management module for my game engine, including things like custom allocators and when it came to allocating memory for strings I kinda got stuck. What I mean by strings ...
0
votes
1answer
63 views

C++:Segmentation fault (core dumped) while creating gameobject

i made a small code to debug and i get this error player inherit from gameobject code ...
-1
votes
1answer
61 views

C++: passing gameobject as a parameter and then into vector

firstly iam used to java and new to c++ so maybe this will looks a noob's question i will explain this and give a pseudo code and then c++ just so you can understand me i have a player class which ...
8
votes
4answers
5k views

Mechanics to keep mobs and environment alive without using tons of memory?

I'm working on a server for a little mobile MMORPG. This consists mainly of two important features: mobs and environment resources like trees, rocks etc. The world is randomly generated and each time ...
2
votes
0answers
197 views

Using shared memory instead of marshalling for C++ native plugins in Unity?

So I'm a C++ developer who has been playing with C# for a week or two in order to get acquainted with Unity, and I'm curious about the marshalling process used to transfer data for use in C++ native ...
8
votes
1answer
422 views

Do SpriteBuilder's Smart Sprite Sheet need to be loaded to memory?

When I create an Smart Sprite Sheet Folder using SpriteBuilder and publish it, must I load that SpriteSheet into memory "FrameCache" with code or does SpriteBuilder do this automatically (so I just ...
1
vote
1answer
62 views

Memory tracker allocates while outputting results

I've written a memory tracker for use in my game engine. I based it on this slide in a talk by Nicolai Josuttis. One problem I'm having is that, during reporting, the implicit string conversion and ...
0
votes
0answers
225 views

Unity light baking out of memory

I have a problem where whenever I try to bake the light in my scene I get this error after a while: ...
18
votes
3answers
2k views

How do you prepare for out of memory conditions?

This can be easy for games with well defined scope, but the question is about sandbox games, where the player is allowed to create and build anything. Possible techniques: Use memory pools with ...
1
vote
0answers
53 views

Estimate an AssetBundle size in RAM

I'm working on a small tool on top of the Asset bundle browser to estimate how much size in RAM a bundle will take so I can put a hard limit / validation before a bundle is submitted to version ...
1
vote
2answers
185 views

Unreasonably large memory use with high-res screenshot script

I'm using this piece of code to save renders and I'm saving renders in every frame inside Update(). Code: ...
0
votes
0answers
32 views

How to find the source of a memory leak in a Blockchain + Node.js game

We have been working in a Node.js game, part of a game network, which seems to be working slower and slower as you keep it open, as well as it seems to increase the RAM and CPU usage over time. We ...
1
vote
1answer
133 views

For PC game development with Visual Studio, how do AAA developers reconcile their dozens-of-GB games with VS's 4 GB memory limits?

As far as I understand it, Visual Studio is the de-facto standard for Windows development in C# and C++, but it is limited by the fact that it's a 32-bit application and thus only has access to 4 GB ...
1
vote
1answer
97 views

Vulkan - preallocating chunks of memory and resource memory requirements

I would like to allocate a bigger chunk of memory and then suballocate from it but I don't fully understand how memory requirements work, is there a chance that when I allocate a piece of device local ...
0
votes
1answer
45 views

Memory Management when changing Game States [closed]

I am just wondering what are some of the issues of loading and freeing the memory every time player changes the game state? Or is it better to load all the resources at once?
0
votes
2answers
78 views

Any advantage of having chunks with sizes by the power of two?

With my past experience of having my little game lag because of the size of the world, I have decided that in whatever next project I might choose to create, I will split said world into chunks. Now ...
0
votes
0answers
62 views

How should I send large amounts of data from java to c++ (within the same process)

I'm writing a game that is mostly in Java (because that's the language I'm most comfortable with) while the graphics are in C++ (because of speed, and because the Vulkan API is hard enough to learn ...
1
vote
1answer
103 views

How did older games manage their sprites? [closed]

I’m aware that older games would reuse sprites as much as possible (Like the bushes and clouds in Mario, or slime and red slime in dragon quest), how did they manage their sprites? Did they preload ...
0
votes
1answer
344 views

How do open world games handle efficiently enemy respawn?

I'm currently working on a 2D open world game loaded in chunks, initially I thought It would be sufficient to spawn entities randomly in a specific "radius" close to the player, and periodically ...
1
vote
1answer
877 views

Memory is not getting freed on Destroy()

Manager script(simple script attached to an empty GameObject on scene) on Start() instantiates 1000 default cubes with rigidbody component added and gravity check ticked. ...
-1
votes
1answer
56 views

Static variable pre-declaration & memory heap expansion in Unity

When I profile my apps, I make sure that the code like this one: private void Update(){ int count = GetEnemyCount(); } get's converted to this one: ...
0
votes
1answer
80 views

Let both clients know of complete game-state in turn-based game?

I'm writing a simple turn-based game for mobile, just to test the waters and I'm having doubts about the approach. Each player has 5 cards on hand. I want for both players to be able to replay ...
1
vote
1answer
499 views

How can I make a custom memory allocation for classes with virtual methods? [closed]

I want to create a custom allocator that stores objects to the heap sequentially. The allocator itself is very simple. It just allocates a big chunk of memory and moves an offset as ...
18
votes
2answers
6k views

Does allocating and freeing a huge chunk of memory at startup “clean up memory?”

The book Game Coding Complete, Fourth Edition, chapter 5 (Game Initialization and Shutdown), section Checking Memory contains this interesting code sample: ...
10
votes
3answers
3k views

Why is custom memory management needed for assets?

Pretty much all resources relating to game programming, especially 3D open-world games, talk about how you have to constantly be unloading and reloading assets to and from disk, system memory, and ...
3
votes
1answer
3k views

How to properly manage memory in SDL2?

I have yet another question regarding SDL2. I have some drawSprite & drawBackround & ...
2
votes
2answers
157 views

How can I read values from a running instance of an existing game? [closed]

I play an indie flight simulation game in Windows. I want to add a specific feature by means of creating a third-party add-on. This apps will "link" and gather current altitude and position data from ...
2
votes
1answer
513 views

How can I build a data structure that will persist across saves/loads in GameMaker version 8.1 and earlier?

I wish to build data structures such as trees, linked lists, graphs, stacks, queues, etc. in Game Maker. However, the concept of object in Game Maker Version 8.1 and older does not have a reliable ...
1
vote
2answers
518 views

Voxel Game - High Memory and CPU Usage

I am currently developing a voxel game and I had recently noticed that the game from startup is at around 2GB of memory. Currently I am rendering 14 x 14 chunks as shown: I did a profile on the game ...
1
vote
0answers
407 views

How to load data from stbi allocated memory into java managed memory?

LWJGL3 provides me with simple wrappers around nothings' stb libraries. In order to load images I thus make use of the stb_image wrapper. My issue is that when I use this wrapper library, all I get ...
1
vote
1answer
700 views

Unity engine memory usage issue - taking up more than it should

I'm making a 2D game that consists mostly of sprites. As a lot of them were too large in file size, I swapped them into meshes with unlit materials without textures. Now, The problem is that Unity by ...
1
vote
0answers
36 views

Unity inconsistent memory profiling when running same scene

I'm in the making of a 2D silhouette style game where I'm trying basically 2 setups: One where it consists only of sprites, One where it consists of a mix of sprites and meshes with NO texture. Now,...
0
votes
1answer
299 views

Efficient Dynamic Memory Management

My world is procedurally generated. As the player moves, chunks behind them are unloaded and chunks in front of them are loaded. Each chunk has a mesh of triangles. At the moment, I create two VBOs ...
-6
votes
1answer
279 views

Should I use reference counting on entities in component-based entity system? [closed]

In component-based entity system, should game objects be reference counted? What about components? Tell me please your pro and contra.
2
votes
0answers
73 views

Are there well-known tools for chasing down VRAM & GTT memory leaks? [closed]

Problem. I have inherited a large C++ 3D graphics codebase (with some shader code). The program runs for about 1-5 minutes before crashing. Problem Data. Using system tools, one can see a sharp rise ...
12
votes
1answer
2k views

How do I know if memory isn't being handled right?

My (2D) game's memory footprint seems to increase any time I load a texture, e.g. when I start my game it uses 30 mb private RAM, after transversing a ~367mb background file, so it's all in RAM at ...
1
vote
0answers
73 views

Memory usage increasing ~10kb every frame [closed]

I am currently developing a game for Android (using the SDK) and have been trying to reduce the memory usage. I have discovered that during each frame, the memory usage increases by about 10kb. The ...
2
votes
3answers
604 views

Is replacing a struct field in a class generating garbage using C#?

I am somewhat aware of the differences between classes and structs, when each is allocated on the heap vs the stack, what happens when calling methods etc. As far as I know, the memory for a struct ...
19
votes
2answers
4k views

How does GPU handle texture and VRAM?

It's actually a bunch of inter-related questions: Are compressed textures (dxt5/dxt1 etc.) ever completely decompressed while going through rendering pipeline? If the answer to the first question is ...
1
vote
1answer
274 views

How can I ensure a Unity game continues to run in RAM, even if the disk it loaded from is removed?

I'd like to make a game with Unity, put the build with all the data on a USB key, plug it in another Windows computer, and run the game from the USB drive, then remove the USB drive, but keep the game ...
-2
votes
3answers
230 views

How should I store a large number of rooms with objects in them?

Right now I'm using C# in XNA/MonoGame. I'm brainstorming an isometric game that consists of rectangular rooms. The allowed dimensions of each room range from 3x3x3 to 12x12x6. The max volume of each ...
23
votes
4answers
9k views

How do C++ games handle memory allocation failure?

I am aware of several games which are written in C++ but do not use exceptions. Since handling of memory allocation failure in C++ is generally built around the ...
1
vote
0answers
367 views

Texture rebind on android cause potential memory leak?

After context lost, I have to rebind all my textures. I want to it the correct way, so I check each handle for availability. It's done by calling unloadFromVram(), ...
1
vote
1answer
333 views

LibGDX: Can i get some useful tips for loading textures?

So basically in my game(completely new to gave dev) I have a level select screen. I have 8 Buttons to select the levels and i use an asset manager to load the textures for the buttons. For example ...
3
votes
1answer
768 views

RAM usage unusually high, but CPU usage relatively low

I've created a relatively simple game using libgdx, but the RAM usage when I start up the game on my Android device is roughly 600-700 mb, but the CPU usage is only about ~0.05%. I've downloaded a ...