Questions tagged [memory]
The memory tag has no summary.
118 questions
1
vote
0
answers
51
views
Reserved Memory Keep Increasing When Loading the Same GameObject Using Unity Addressables
I'm trying to learn how to use Addressables in Unity to improve memory usage, but there's something I don't understand.
I use ...
0
votes
0
answers
118
views
Unable to determine cause of memory leak in Unity when using Addressables. Can anyone give suggestions on what the cause might be?
I'm creating a simple bullet hell game for Android and I ran into an issue when diagnosing my game using the Memory Profiler where memory usage was increasing after each play-through. I had calls to ...
0
votes
1
answer
175
views
Is memcpy safe to use to fill an ID3DBlob with a pre-compiled shader?
Following my post Saving shaders to file I then tried to load shader object files to recreate my shaders.
I found some Q&A about how to load precompiled HLSL shaders into memory, including a short ...
0
votes
0
answers
156
views
Browser memory increasing the longer Unity WebGL build runs
I have an app in Unity WebGL that should run for a long time (a few days) without stopping. One issue I notice is that, the longer the app runs the browser memory usage gets bigger. Is this related to ...
0
votes
1
answer
161
views
Why does this function cause memory leaks?
I'm trying to make a pickup and drop script by myself and every time the game calls the pickup function, it seemed to cause memory leaks and freezes the game for few seconds.
After those few seconds, ...
1
vote
0
answers
138
views
What causes the Garbage Collector to spike and drop the framerate here?
I'm trying to optimize my first game project. It reaches between 55-60 FPS while playing, but there is a problem. As in the screenshot, the Garbage Collector section sometimes causes increases. This ...
1
vote
1
answer
266
views
I am testing the flyweight pattern on thousands of GameObjects but its not helping save memory. What am I doing wrong here?
I am trying to understand the flyweight pattern better by trying to optimize memory usage by spawning 10000 copies of an enemy GameObject that I have which has an Animator component, SpriteRenderer ...
0
votes
2
answers
543
views
Stray (orphaned) nodes remain after queue_free() of their parent scene
Godot 4.2.1
I have implemented a simple scene-save system:
The Savegame Autoload listens for the S key press.
When S is pressed, the ...
1
vote
1
answer
445
views
Creating a Renderer class using SFML
I currently have a Renderer class, which as in the example code, looks like this:
...
1
vote
0
answers
2k
views
Untracked memory in Unity's Profiler
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'...
2
votes
1
answer
1k
views
How to prevent memory hacks?
For cheating or maybe just making some trainers, it's possible for hackers to read and update variables directly in the game's memory.
Is this something that can simply be prevented, or is the answer ...
3
votes
1
answer
4k
views
Rotating a Unity Texture2D 90/180 degrees without using GetPixels32 or SetPixels32? (To avoid heap fragmentation)
I have a script which is loading a photo from path into a texture (photoThumbT2D), then rotating it:
...
0
votes
0
answers
674
views
Directx12 command list reset close memory leak
I simply reset and close the command list but my memory usage goes up 5 gb per second.
This is the simple list of things I do
Reset command buffer
Close command buffer
Reset command allocator
I feel ...
0
votes
0
answers
258
views
Unity sprite takes 5 times more memory in profiler
So as stated I have a sprite that when compressed takes 2 MB. But when I look into the memory in the profiler, it says that the sprite uses 10 MB! This happens both when I profile in the unity editor ...
4
votes
1
answer
1k
views
Should you avoid memory allocation and deallocation while the game is running?
I recently read this answer on this site, which says the following:
making sure no allocation/deallocation is being done while the game is running is a golden rule of thumb.
I interpret this as ...
0
votes
2
answers
783
views
If I create a prefab out of an object on scene will my game take more memory in Unity?
If I create a prefab out of an object on scene will my game take more memory in Unity?
I have 30 enemies on my scene. I created a prefab for every one of them. I am going to use each of the created ...
5
votes
1
answer
4k
views
What is happening during queue_free() process?
From time to time, I encounter a hard-to-reproduce bug with a similar line of code:
...
2
votes
1
answer
2k
views
How do signals work when queue_free is called?
Consider this setup:
* KinematicBody2D (Player)
|- Sprite (icon.png)
|- VisibilityNotifier2D
With Player.gd:
...
1
vote
1
answer
989
views
How to debug UnityGfxDeviceWorker (34): EXC_RESOURCE RESOURCE_TYPE_MEMORY error on an iOS device?
How does one debug this Xcode error on an iOS device?
Debug - UnityGfxDeviceWorker (34): EXC_RESOURCE RESOURCE_TYPE_MEMORY
1
vote
1
answer
258
views
Right way to dispose of a WWW IEnumerator after it has completed - Unity
What is the "right" way to dispose of an Ienumerator coroutine after it has completed?
0
votes
0
answers
97
views
Running into memory issues during procedural generation
I'm procedurally generating a map of hex cells and creating a variety of paths along this grid. As I'm creating these paths every about 10 runs of the game, Unity is running out of memory while ...
1
vote
0
answers
65
views
How can I remove sprites when they are outside viewport, but then add them again if I return to their location to save memory
I'm creating an open-world RPG like Neverwinter nights. But I’m worried about memory and am afraid if I just populate a huge world with physics based sprite nodes, I won't have any memory for anything ...
0
votes
1
answer
101
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-...
6
votes
1
answer
1k
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.
...
4
votes
2
answers
2k
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
1
answer
1k
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
...
0
votes
1
answer
391
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
4
answers
6k
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
0
answers
867
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 ...
0
votes
2
answers
582
views
How do I download audio resources and cache them?
I am developing a game in Unity 2019. The instructions of the game must be translated into several languages. Currently they are part of the compilation, but this makes the compilation very large.
I ...
1
vote
1
answer
98
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 ...
1
vote
2
answers
587
views
Disposing objects when changing screens [closed]
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? ...
1
vote
0
answers
306
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
2
answers
1k
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
0
answers
55
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
1
answer
210
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 ...
0
votes
1
answer
68
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
2
answers
300
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 ...
1
vote
1
answer
329
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 ...
1
vote
1
answer
296
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
1
answer
867
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
1
answer
3k
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
1
answer
117
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
1
answer
147
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
1
answer
1k
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 ...
3
votes
1
answer
8k
views
How to properly manage memory in SDL2?
I have yet another question regarding SDL2.
I have some drawSprite & drawBackround & ...
2
votes
2
answers
3k
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
0
answers
747
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
0
answers
53
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
1
answer
982
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 ...