Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [memory]

The tag has no usage guidance.

0
votes
0answers
33 views

Unexpected memory use by meshes in a scene with only canvasses & images [closed]

I have a weird memory issue. I have 10 canvases in my scene. If I delete them all, my meshes get removed and memory is reduced, even though I don’t have meshes at all. If I delete 9 and leave 1, ...
0
votes
2answers
54 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
29 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
0answers
38 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
votes
0answers
54 views

Why does memory usage increase when using SDL2?

I recently started to explore SDL2, but i had some memory leak somewhere, so i decided to rewrite the program one step at a time and check for leak. I found that SDL_CreateWindow() - SDL_DestroyWindow(...
-1
votes
0answers
27 views

Large Terrain Renderer Initial Buffer Allocation Size

I am working on rendering terrain using a tiff height map. I put my terrain in a quad tree, where each subdivision represents the tiles in a given pyramid level in the tiff. Since each tiff tile is ...
-1
votes
0answers
28 views

Using a dynamic array on multiple instances of a class causes problem

I managed to get a A* pathfinding algorithm to work on my game and I want the enemies to all behave according to their path but only one at a time can follow his path and the others just get stuck ...
1
vote
1answer
75 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
166 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 ...
0
votes
0answers
47 views

Loading of images java libgdx

We are building java war 2 pc game. And we have problem with memory. Our resources are about 850mb(images 750, thousands of small images). This is development phase, so it will be less when we delete ...
1
vote
1answer
249 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
39 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
67 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
196 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 ...
2
votes
1answer
866 views

How to properly manage memory in SDL2?

I have yet another question regarding SDL2. I have some drawSprite & drawBackround & ...
2
votes
2answers
97 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 ...
1
vote
0answers
237 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
0answers
32 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,...
1
vote
1answer
484 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 ...
0
votes
1answer
230 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 ...
1
vote
2answers
297 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 ...
2
votes
1answer
356 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 ...
3
votes
0answers
60 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 ...
0
votes
0answers
184 views

D3D11 virtual adress space usage on Windows 10

I work on a renderer framework. When I create texture with CreateTexture2D, D3D11 device immediatly allocates some memory from virtual space of the process despite there is no cpu access flags etc. or ...
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
65 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
354 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 ...
18
votes
2answers
3k 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 ...
-2
votes
3answers
190 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 ...
21
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
275 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
230 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 ...
4
votes
1answer
659 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 ...
3
votes
1answer
200 views

Is keeping all my game art in a static class wasting memory?

When I make games, I generally create a static class called Art that has static fields to track all content in the game. For example ...
1
vote
1answer
695 views

About HLSL array packing policy

This is not a question but a confirmation if I'm correct about the behavior of HLSL arrays. I'm working with a standard lighting vertex shader, HLSL plus C++, DirectX11.1 API. For storing my lights ...
1
vote
0answers
183 views

Memory leak with glfwSetWindowTitle? [closed]

I am using GLFW for a game, and I have a function which allows me to set the window title. ...
1
vote
0answers
44 views

Animated Typing Memory Usage with Immutable Strings

Right now I'm programming a game that has an animated typing effect typically seen in older 1980's and 90's role-playing games. An example can be seen here. The typing effect is generated by taking a ...
1
vote
1answer
189 views

Why loading ~250mb of compressed texture data spills Out of memory error on Windows

I am making SDL2/OpenGL 2D game for Windows with a lot of pre-rendered sprites. When testing on my laptop I got SDL_Surface creation failed: out of memory error ...
-2
votes
1answer
629 views

Libgdx incredibly high RAM usage! [closed]

Alright so I'm new to Libgdx and Game programming in general, and I've got a huge problem. If I leave my game on, it will start to eat memory, pretty fast at that, until it reaches a point my PC hasn'...
1
vote
1answer
353 views

Method of handling audio and memory in game

I've started coding a new game project and I've implemented Ogre for the graphics rendering and begun thinking about the audio side of things. I was considering using the SFML audio component for ...
2
votes
1answer
114 views

Java - Loading background music into memory

I am currently developing a game with Java, with a soundtrack consisting of ten tracks in .ogg format, 1-2 MB in size each. To be able to switch between these tracks quickly and easily in the game, ...
2
votes
0answers
260 views

SDL2 SDL_CreateTexture returns pointer to existing texture

I have an initialized renderer in SDL2 that works fine. I create some textures from images using SDL_CreateTextureFromSurface and store them in a vector. ...
1
vote
1answer
268 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 ...
1
vote
2answers
116 views

How can I minimise memory thrashing when doing vector math in JavaScript or ActionScript?

Please note that a similar question has been asked before in the context of C#. Say I'm building a 3D game in Javascript or Actionscript, and doing a lot of 3D vector math. In current libraries, ...
4
votes
1answer
356 views

When does the memory transfer from CPU to GPU happen when creating a buffer?

I just finished my first DirectX 11 program. But I have several questions on memory transfer between CPU and GPU. In my program, I create a vertex buffer first: ...
1
vote
2answers
285 views

Smallest, most memory-efficient way to have tiles? (C++/OpenGL)

I need to have tiles in my game, just 16x16 images, there would be hundreds (or even thousands) that make up a level. Of course it's not viable to have thousands of memory-hog normal entities, but ...
0
votes
1answer
613 views

Segmentation fault on reallocation of memory but why? [closed]

I have been learning to code in C from this amazing resource http://c.learncodethehardway.org/book/ I am on exercise 17. Basically creating your own simple database using Malloc. I modified the ...
1
vote
1answer
2k views

Unity: why game app on Android takes up much more memory than Unity Profiler reports?

We are profiling a game app on Android 4.4.2 device via Unity’s ADB profiling. We have set up ADB profiling following the official guide: http://docs.unity3d.com/Manual/Profiler.html The ADB ...
7
votes
2answers
528 views

Should a game clean up after itself when exiting? [closed]

Should a game/engine clean up after itself(close windows, shut down renderers, close files, free memory) when its closed? The OS should do that anyway, and usually in a faster way. I guess most ...
1
vote
2answers
542 views

Efficient UI for RTS units

I was wondering how I should approach the runtime changes on the game UI when selecting different types of units in a RTS. For example, in Starcraft, each unit type has its own portrait, attributes, ...