|
Is this statement true, false, or poorly formulated:
"In Java, memory leaks must always be related somehow to a long-lived object."
In this context, I am referring simply to regular objects, and not to system resources in general (file descriptors, and...
Started by John O on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Interesting article here....
While the statement is technically true, the memory leak is caused by objects that live.
Be related somehow to a long-lived object."
A long-lived object is a Singleton, or something that will liveMisleading.
|
|
I've read some articles on the web and some questions on StackOverFlow, but no one seems to have a definite answer over a) If google uses Long Lived TCP connections for Gmail, Mail etc, and b) If using it in a custom app will drain battery life , and ...
Started by Faisal Abid on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
On a regular interval (assume the same "refresh" rate as for the long-lived connection "trickle") : each.
|
|
I keep a JMS connection always open, because I have a MessageListener on it.
Is it a common need to worry about minimizing maintenance of applications with long lived JMS connections?
I was thinking something along the lines of try to recover from some...
Answer Snippets (Read the full thread at stackoverflow):
This is a TCP....
If this is the case, send a message every hour or so or, if you can, enable TCP_KEEPALIVE .
Most firewalls will cut an "idle" connection after a couple of hours .
Your will need to handle two cases:
Firewall between you and the JMS server .
|
Ask your Facebook Friends
|
I know this is a subjective question, but why does Hibernate seem to be designed for short lived sessions? Generally in my apps I create DAOs to abstract my data layer, but since I can't predict how the entity objects are going to be used some of its ...
Started by Allain Lalonde on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Several frameworks implement this so it handles ....
You're looking for the OpenSessionInView pattern, which is essentially a conceptual filter (and sometimes implemented as a servlet filter) that detects when a session needs to be transparently reopened .
|
|
We are using NHibernate to manage our persistence in a complex modular windows forms application - but one thought keeps bothering me. We currently open a session on launch and open all objects through that session. I am worried that all loaded objects...
Started by Ewan Makepeace on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
This one....
I can see a couple of alternatives:
Eager-load the object tree (which, from what I can gather from the documentation is the default) Detach the objects, intercept the "click" event, and load the data from the database then, with a new session .
|
|
We have a discussion going on in my team at the moment, and I'd be interested in other views. Suppose we have a RESTful web service whose role is to annotate documents by applying a variety of analysis algorithms and services. The basic interaction in...
Started by Ian Dickinson on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
I would implement it the following way:
1) client requests metadata
2) server returns either actual data (if it's already available) or NotReady marker
3) client asks server when data will be available (this step can be merger with previous)
4) server... .
|
|
What is the overhead of generating a lot of temporary objects (i.e. for interim results) that "die young" (never promoted to the next generation during a garbage collection interval)? I'm assuming that the "new" operation is very cheap, as it is really...
Started by Jen on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
The cost of generating lots of short lived objects is more frequent, a generation 0 collection is fairly cheap, so as long as your object really are short lived the overhead is generational in ....
The allocation itself is very inexpensive.
|
|
When you need to have very small objects, say that contains 2 float property, and you will have millions of them that aren't gonna be "destroyed" right away, are structs a better choice or classes?
Like in xna as a library, there are point3s, etc as structs...
Started by Joan Venge on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Not that clear how, if at all, this heap defrags itself, however for very long lived objects that perhaps.
|
|
I'm working on a web-based application that is intended to have at least a 6 year lifetime. Once the application is delivered, chances are that it won't be modified during that time frame.
We're considering using the asp.net MVC framework and jQuery, ...
Started by chris on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The web will probably always be doomed to staying backward compatible... .
There is such a huge investment in working with JQuery from several big enterprises that I doubt you will run into those kinds of issues .
You probably won't have to worry about that.
|
|
I've got a small class (16 bytes on a 32bit system) which I need to dynamically allocate. In most cases the life-time of any given instance is very short. Some instances may also be passed across thread boundaries.
Having done some profiling, I found ...
Started by Fire Lancer on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Another suggestion is to place the objects into a Singleton class and access them through that class... .
The std::vector or an array will reduce fragmentation in the dynamic memory area .
For many small objects, I suggest using either std::map or std::vector .
|