|
2011-02-10
, 13:14
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#142
|
Hm,
The page you quoted is about memory fregmantation when many
windows (or pages) are opended even right after start. So,
if all is good again, even if you restart your session with all tabs,
I don't believe this memory fragmentation was the reason.
Loading a bunch of windows and closing them and clearing my caches
So.. What does this mean?
Well, it means that any allocations >4k are going at the end because we can’t really fit them anywhere earlier. This is bad for a variety of reasons including performance. It makes it very difficult for us to get big chunks of contiguous memory to give back to the OS. This makes us look big!
And back to square one. Comparing a language to a platform. Why do you say only Java can have a VM type solution or that a Java VM solution is the best VM solution ?
Now that is plain FUD. The memory leaks that are caused by pointer assignments are easily detectable with the proper tools, and if you use things like Qt, handled automatically (say hello to guarded and scoped/reference counting pointers). *Logic* based leaks (i.e. not getting rid of objects you don't really need) is a different matter and no choice of language will help you there.
BTW So now Chrome and Opera are slow and leaky, too ?
|
2011-02-10
, 13:20
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#143
|
If you mean GC as Garbage collector, no, a memory pool
would help. There is less memory fragmentation with a GC,
just because a GC manages a bigger memory pool.
It is a common mistake to think, a programing language with
a GC avoids memory leaks.
|
2011-02-10
, 13:28
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#144
|
No. The page is about memory fragmentation when many windows, tabs, or pages are opened and closed right after the start.
I haven't looked (yet) how Qt tries to tackle the heap memory fragmentation problem
("guarded and scoped/reference counting pointers"),
As I said, you can try to avoid using direct pointers and arrays everywhere in C++ code, but then in fact you are building a similar kind of clever CG Java for example has (and Python will have if it doesn't already).
|
2011-02-10
, 13:34
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#145
|
|
2011-02-10
, 13:43
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#146
|
One of the reasons why Firefox slows down and "leaks" memory, which you notice after several days heavy use, is because it has been coded with C++ and it cannot use this extra running time information for optimization.
|
2011-02-10
, 13:52
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#147
|
@zimon
You are right a GC (and the heap memory management) can help
to prevent memory fragmentation. And to do this java is more
appropiate than C++. But my point was:
Memory fragmentation and memory leaks are different things.
And the blog post you quoted is about memory fragmentation
and not about "slows down and leaks memory after several days".
|
2011-02-10
, 19:07
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#148
|
It doesn't have to be several days to notice the problem if you just open and close lots of pages like the guy in the link did. And if you use heap memory printing like he does, you notice the problem before it affects the speed of the application.
|
2011-02-10
, 20:40
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#149
|
You're still trying to find faults in specific (historical) implementations and then pin it to C++ as whole, past present and future. The Firefox article is from 2007, so probably Firefox 2.x. Starting with 3.x, Firefox uses jedmalloc, which solves that problem (so whatever you think is making your firefox slow today, it's not memory fragmentation - more likely Flash or some other junk ).
|
2011-02-10
, 21:03
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#150
|
I think you are wrong. Saying it starts "swapping after few days" was somewhat overrated from me, but eventually it would start swapping also if I wouldn't restart.
The pointers in C code will always be a problem. There is numerous studies done to make better garbage collectors and memory managements, but pointers are always the problem. It is not a accident modern programming languages do not use pointers but only references.
Tags |
bada rox, dalvik, future, java haters, meego, meego?fail, nokia, sandbox sucks |
|
would help. There is less memory fragmentation with a GC,
just because a GC manages a bigger memory pool.
a GC avoids memory leaks.
my contributions:
Desktop Clock Widget|Calendar Home Widget|Lens Cover Reminder|ConnectNow|Scout|App Search Widget|ProfilesX|
Desktop-Switcher|SMS-Messageblocker
-Donate-