Programming Basics: Memory Management Across Languages


show more Memory management is an important part of programming in many languages. Memory Management Across Languages, as part of the Foundations of Programming course, covers how developers manage the memory an object uses, allocating the memory needed for the lifetime of the object and freeing it when it's needed for other objects. Learn the fundamentals of memory management and garbage collection from this Lynda.com JavaScript tutorial. show less
please wait ...

Memory management across languages

There's one thing we haven't talked about so far in any detail, and that's memory. Well, that's really because in JavaScript, we don't have to talk about it. We create our variables and our objects, we use them, and we forget about them. But this isn't always the case. In several languages, you can't just create an object, use it, and forget about it. You have to manage the memory that, that object uses, manage the lifetime of that object. If I was to show you some pseudo code examples, it would be that instead of just creating an object, we first have to manually allocate an area of memory.

We have to grab hold of a piece of RAM and say, "I am going to use this." Then we can create our object and we can point it to that area of memory. We say, "That's what you are using. That's where your data is being stored." We use that reference what's called a pointer to that object and just use the object, call its methods, access its prop...

Memory management across languages
Video duration: 5m 11s 4h 47m Beginner

Viewers:

Memory management is an important part of programming in many languages. Memory Management Across Languages, as part of the Foundations of Programming course, covers how developers manage the memory an object uses, allocating the memory needed for the lifetime of the object and freeing it when it's needed for other objects. Learn the fundamentals of memory management and garbage collection from this Lynda.com JavaScript tutorial.

Subjects:
Developer Web
Author:
please wait ...