M
M
Mishka_Sev2020-06-01 04:49:37
Programming
Mishka_Sev, 2020-06-01 04:49:37

How to track your memory yourself?

Languages ​​like JavaScript use garbage collectors.
But, what if the programmer himself wants to make decisions and monitor the memory, independently determining when the value will be achievable and when not, manually unloading the unnecessary from memory.
If this is possible, what is it called, approach, paradigm, etc.?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2020-06-01
@Mishka_Sev

in JS, no way. You can only do various optimizations on top of the garbage collector - a pool of objects, reuse arrays, not create functions for every sneeze, and so on. But the big question is why do you need it.
If you don't have a real-time application with a lot of data - make sure there are no memory leaks and calm down :)
If your soul just asks for a different one, then you need a different language. And accordingly it will not be a web (except perhaps through WASI, but this is not accurate)

But what if the programmer wants to make decisions himself and keep track of memory

Such a programmer should be sent to hardcore embedded development and he will be happy there, counting bytes and cleaning registers. And if you get out of there and try to monitor the memory yourself where there are proven built-in mechanisms (GC, ARC, etc.), you need to select the keyboard.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question