garbage-collection

Does the JS garbage collector clear stack memory?

大憨熊 提交于 2020-01-02 11:07:13
问题 Following the first comment on this question: What makes this function run much slower? Does the garbage collector sweep stack memory? From what I've read, usually gc's don't do this. Following this question, I imagine that there is no physical difference between stack and heap memory; is there a virtual division? What I mean is: what happens when theoretically all stack memory is used without causing an overflow and new memory is allocated to an object after that? Could someone elaborate on

Lua - Count the no. of references to a table

橙三吉。 提交于 2020-01-02 10:22:31
问题 The Lua docs say When a program has no references to a table left, Lua memory management will eventually delete the table and reuse its memory. My question is : Is it possible to count the no of references to a particular table during runtime? 回答1: You can find all references to a Lua value using the debug library. See these messages: http://lua-users.org/lists/lua-l/2012-03/msg00479.html http://lua-users.org/lists/lua-l/2012-04/msg00758.html The luatraverse library found in the below link

Lua - Count the no. of references to a table

烂漫一生 提交于 2020-01-02 10:21:29
问题 The Lua docs say When a program has no references to a table left, Lua memory management will eventually delete the table and reuse its memory. My question is : Is it possible to count the no of references to a particular table during runtime? 回答1: You can find all references to a Lua value using the debug library. See these messages: http://lua-users.org/lists/lua-l/2012-03/msg00479.html http://lua-users.org/lists/lua-l/2012-04/msg00758.html The luatraverse library found in the below link

When log shows a lot of GC hits, what code change shall we need?

梦想的初衷 提交于 2020-01-02 10:02:40
问题 When log shows a lot of Garbage Collection hits, what code change shall we need? Do we need to free some objects? Will we speed up the code with object reusal? EDIT I run this code against a lot of names: public static String removeAccents(String s) { if (s == null) return null; StringBuilder sb = new StringBuilder(); int n = s.length(); for (int i = 0; i < n; i++) { char c = s.charAt(i); int pos = UNICODE.indexOf(c); if (pos > -1) { sb.append(PLAIN_ASCII.charAt(pos)); } else { sb.append(c);

When log shows a lot of GC hits, what code change shall we need?

只谈情不闲聊 提交于 2020-01-02 10:02:24
问题 When log shows a lot of Garbage Collection hits, what code change shall we need? Do we need to free some objects? Will we speed up the code with object reusal? EDIT I run this code against a lot of names: public static String removeAccents(String s) { if (s == null) return null; StringBuilder sb = new StringBuilder(); int n = s.length(); for (int i = 0; i < n; i++) { char c = s.charAt(i); int pos = UNICODE.indexOf(c); if (pos > -1) { sb.append(PLAIN_ASCII.charAt(pos)); } else { sb.append(c);

Difference between 3rd gen objects and large object heap

只谈情不闲聊 提交于 2020-01-02 06:25:17
问题 What is the difference between large object heap and GC 3rd generation objects? 回答1: The LOH (Large Object Heap) is a single heap where large objects are allocated directly and stay there until they are collected. Objects are directly allocated into the LOH based on their size e.g. being equal or greater than 85000 bytes. Generational objects are "small" objects that are allocated into the SOH (Small Object Heap) which is a single heap. Objects in the SOH have an associated generation which

java garbage collector - “get” the deleted objects

℡╲_俬逩灬. 提交于 2020-01-02 05:19:22
问题 is there a possibility to see which objects will be removed with the garbage collector? I do not need the content of the object, but the class of the object is necessary. I try to write a real time application, which creates and deletes a lot of objects and after a while the application slow down. At the moment I'm not sure whether it's a problem of my code or from the external libraries. So perfect would be an output, which identifies all classes, which has been removed, together with their

java garbage collector - “get” the deleted objects

家住魔仙堡 提交于 2020-01-02 05:19:20
问题 is there a possibility to see which objects will be removed with the garbage collector? I do not need the content of the object, but the class of the object is necessary. I try to write a real time application, which creates and deletes a lot of objects and after a while the application slow down. At the moment I'm not sure whether it's a problem of my code or from the external libraries. So perfect would be an output, which identifies all classes, which has been removed, together with their

Is Java GC Deterministic

梦想的初衷 提交于 2020-01-02 05:13:47
问题 I am running multiple runs of the same scenario on a Java product with same JVM arguments. Every run gives a different GC behavior both in terms of its duration and its 'start time'. Is this expected? 回答1: Are you manually running System.gc() ? Becuase that's not guaranteed to actually do the garbage collection immediately (or even at all). For automatic garbage collection, I'd assume it's the same where the JVM determines a good time to do the garbage collection. 回答2: The Java VM

Are custom blocks ever copied by OCaml?

[亡魂溺海] 提交于 2020-01-02 04:44:11
问题 Imagine I've a C library called libcat for interacting with my cat fluffy. I'm therefore writing bindings for OCaml to simplify interactions with fluffy. module type CAT = sig type cat val find : ... -> cat val feed : cat -> unit ... end ;; module Cat : CAT = ... There is considerable memory management already built into libcat, like say caching, freeing destroyed toys, and maybe even a limited scope garbage collector for emptying the litter. Yet, overall libcat requires that users explicitly