garbage-collection

How to use lua_pop() function correctly?

孤人 提交于 2020-01-21 01:41:33
问题 Can anyone pls tell me that how to use lua_pop() function correctly in C++. Should I call it when I use a lua_get*() function ? like. lua_getglobal(L, "something"); lua_pop(L, 1); or how to use it ? Will the garbage collector clear those stuff after the threshold ? Thanks. 回答1: You call lua_pop() to remove items from the Lua stack. For simple functions, this can be entirely unnecessary since the core will clean up the stack as part of handling the return values. For more complex functions,

Why make short and long-lived objects a difference in garbage collection?

血红的双手。 提交于 2020-01-19 22:31:05
问题 I've often read that in the Sun JVM short-lived objects ("relatively new objects") can be garbage collected more efficiently than long-lived objects ("relatively old objects") Why is that so? Is that specific to the Sun JVM or does this result from a general garbage collection principle? 回答1: Most Java apps create Java objects and then discard them rather quickly eg. you create some objects in a method then once you exit the method all the object dies. Most apps behave this way and most

Setting -XX:+DisableExplicitGC in production: what could go wrong?

妖精的绣舞 提交于 2020-01-19 07:06:34
问题 we just had a meeting to address some performance issues in a web application that is used to calculate insurance rates. The calculations are implemented in a C/C++-module, that is used in other software packages as well. To make it available as a webservice, a Java wrapper was implemented that exposes an XML based interface and calls the C/C++-module via JNI. Measurements showed that several seconds were spent on each calculation inside the Java part. So my first recomodation was to enable

How can users enable Background Server GC in a desktop app without changing app.config?

佐手、 提交于 2020-01-17 13:44:14
问题 I look after a WPF desktop app which many users run on varying hardware. Multiple threads constantly churn through a large volume of data. Turning on .NET Framework 4.5 Background server garbage collection has shown significant performance improvements, however this comes at the cost of more memory being used and different CPU usage patterns. This is a potential problem for users with less-powerful machines, so I want to give the users who'd benefit most an opt-in to having server GC enabled

How can users enable Background Server GC in a desktop app without changing app.config?

我的未来我决定 提交于 2020-01-17 13:41:21
问题 I look after a WPF desktop app which many users run on varying hardware. Multiple threads constantly churn through a large volume of data. Turning on .NET Framework 4.5 Background server garbage collection has shown significant performance improvements, however this comes at the cost of more memory being used and different CPU usage patterns. This is a potential problem for users with less-powerful machines, so I want to give the users who'd benefit most an opt-in to having server GC enabled

Why GC does not collect an unused object

女生的网名这么多〃 提交于 2020-01-17 05:00:53
问题 I'm trying to understand how the GC acts when an object is not being used anymore, my test is to do nothing with the object (after used) but it didn't work, the object's destructor was never called. I've created an example program trying to wait until the object is destroyed, but after 4 hours running nothing happens. Note: I know if I set the object to null the GC will collect it, but I just want to see the "normal" way the GC itself collects the object. using System; using System

Undestanding a detail about the colour bits in the ZGC algorithm

早过忘川 提交于 2020-01-16 12:04:56
问题 I'm trying to understand how ZGC works in detail. Let's consider a simple Java example: var v = new Object[]{ new Object() }; Let's call a : the array object o : the object referenced by v[0] r : the reference to a s : the reference to o The image below shows the artefacts graphically: Let's assume that the first gc cycle starts and a , o are relocated. Let's further assume that the app doesn't access the objects. gc cycle 1: a) Marking phase: at the end of the marking phase the marked0 bit

Undestanding a detail about the colour bits in the ZGC algorithm

你说的曾经没有我的故事 提交于 2020-01-16 12:00:12
问题 I'm trying to understand how ZGC works in detail. Let's consider a simple Java example: var v = new Object[]{ new Object() }; Let's call a : the array object o : the object referenced by v[0] r : the reference to a s : the reference to o The image below shows the artefacts graphically: Let's assume that the first gc cycle starts and a , o are relocated. Let's further assume that the app doesn't access the objects. gc cycle 1: a) Marking phase: at the end of the marking phase the marked0 bit

Undestanding a detail about the colour bits in the ZGC algorithm

我的未来我决定 提交于 2020-01-16 12:00:10
问题 I'm trying to understand how ZGC works in detail. Let's consider a simple Java example: var v = new Object[]{ new Object() }; Let's call a : the array object o : the object referenced by v[0] r : the reference to a s : the reference to o The image below shows the artefacts graphically: Let's assume that the first gc cycle starts and a , o are relocated. Let's further assume that the app doesn't access the objects. gc cycle 1: a) Marking phase: at the end of the marking phase the marked0 bit

How would I make garbage collection clean up RCW objects bound to an out-proc COM server?

我是研究僧i 提交于 2020-01-15 15:30:50
问题 I have a 64-bit .NET process that runs for days. The process consumes a native 32-bit COM server using DCOM. Once in a while the COM server runs out of memory because the .NET process garbage collector only sees the RCWs of the COM objects and those are quite lightweight and "not worth collecting". I need to somehow make garbage collector aware of those COM objects. For the record, I tried to run the same code periodically force-starting garbage collection and the problem goes away so the