Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
mr-user13524yWhenever you have to fight the "gc" there is a better way to design it. You have to find the actual root cause of it.
Another way is to use Java Native Interface (JNI) to write it in C/C++ which you can handle the memory however you want. -
This is one of these situations in which I realize the benefit of being able to go low level
Manual memory management can be a pain, but it is necessary from time to time -
Parzi88334y@LotsOfCaffeine how the hell does one do assembly in modern times? Or are you referring to demoscene or retrocoding stuff?
-
mr-user13524y@Parzi
we are talking about C/C++
@Maer
If you have to mess with "gc" you are fucked due to design error. Try to fix up the design.
If you cannot fix up the design due to constraint or cannot think up of anything else, use JNI. -
Maer17824y@Parzi They just mentioned "memory management" which is rather broad.
A list of things that can be considered memory management, descending from highlevel to lowlevel:
- GC calls in Java, then hoping the GC actually collects unreferenced objects
- C++ allocation via new and deallocation via destructor
- C alloc calls
- Assembly level memory mapping
Since there is reference to JNI, this is probably just about C++ memory allocation - at least I think so. -
Root825284y@LotsOfCaffeine It’s really quite sad that some developers think C++ is low level
Edit: algo necro 🙁 -
Root825284y@LotsOfCaffeine Neither despite using it for years.
To me, “low level” means straight assembly or “high-level assembly” compilers. C feels pretty standard to me, or a little lower.
Related Rants
-
Cyborg15A guy and a girl are in a Java seminar. Afterward, the guy approaches the girl and asks, "Hey gurrl, can I ge...
-
BrianValente33I'll start implementing this in my apps too.
-
nmunro15How I've decided to answer the "can you hack" question from here on in... "Can you show me how to hack this a...
I'm not proud of this, but I'm not sure there's a better way of doing this.
Context: texture sheets are massive, so I wanted them to be gced when possible. Problem is, during init, the gc kept collecting the sheets, which added a full 5-10 seconds to load times.
This ensures that the sheets stay in memory until everything is initialized.
random
hack
gc
java
garbage collector