1

I would like to know if in JavaScript is there a possibility to know the memory location and memory used by an object

Any help would be appreciated

  • What do you mean by memory location? Some kind of object ID, or a literal address? – joews Jul 14 '14 at 08:49
  • @RavitejaAvvari, what are you trying to achieve with this object memory? –  Jul 14 '14 at 08:52
  • Not trying to achieve something through coding. As I am learning Javascript I am knowing what I dont know in the form of questions. –  Jul 14 '14 at 09:07

2 Answers2

2

Not from within JavaScript. The language provides no tools to directly manage memory. Memory management is the responsibility the runtime environment.

Some environments may provide you with some of that information to help with debugging / performance optimisation. Chrome Developer Tools, for example, has a Heap Snapshot feature in the profiles tab.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

Definitely it won't show memory address, else it would be a big security loophole. Similar query is here.

JavaScript variables memory location

Community
  • 1
  • 1
Shashwat Kumar
  • 5,159
  • 2
  • 30
  • 66