473,520 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

malloc replacement for windows

Hello,

We have a single-threaded application running on Windows which does a
large number of news and deletes of small chunks of memory (<128 K). I
was looking to improve performance and compiled ptmalloc
(http://www.nedprod.com/programs/Win32/ptmalloc2/) into our
application. On doing so I got a 15% performance improvement. However,
I found the application consuming far more memory than it used to when
using the default malloc. I monitor the memory usage in Task Manager
and it looks as though memory consumption is continuously increasing.
On the other hand using the default malloc causes memory consumption
to increase and decrease through various phases of the program as
expected. I suspect there is too much fragmentation. Are there any
flags I can tweak to reduce this? I already tried enabling the
TRIM_FASTBINS flag.

Also, suggestions for any other malloc replacement under windows would
also be greatly appreciated
Jul 22 '05 #1
3 2912
"Tushar Udeshi" <tu*****@zyvex.com> wrote
...
Also, suggestions for any other malloc replacement
under windows would also be greatly appreciated


Look into SmartHeap and the HOARD allocator (let google be your
guide).

Claudio Puviani
Jul 22 '05 #2
"Claudio Puviani" <pu*****@hotmail.com> wrote in message news:<E3*********************@news4.srv.hcvlny.cv. net>...
"Tushar Udeshi" <tu*****@zyvex.com> wrote
...
Also, suggestions for any other malloc replacement
under windows would also be greatly appreciated


Look into SmartHeap and the HOARD allocator (let google be your
guide).

Claudio Puviani


If speed is of any concern, also look into ESA from Cherrystone
software as well. We (comcast) hired a company to do performance and
scalability testing of various memory managers (because we were just
too darn busy to do it ourselves) and the final result proved to that
ESA from cherrystone was 2x faster than smartheap in the SMP tests.
ESA vs hoard and it was even greater, 10-20x faster than hoard.
Just my 0.02.

Dave Arnette.
da*********@comcast.net
Jul 22 '05 #3
"Dave Arnette" <da*********@comcast.net> wrote
"Claudio Puviani" <pu*****@hotmail.com> wrote
"Tushar Udeshi" <tu*****@zyvex.com> wrote
...
Also, suggestions for any other malloc replacement
under windows would also be greatly appreciated


Look into SmartHeap and the HOARD allocator (let google be your
guide).

Claudio Puviani


If speed is of any concern, also look into ESA from Cherrystone
software as well. We (comcast) hired a company to do performance and
scalability testing of various memory managers (because we were just
too darn busy to do it ourselves) and the final result proved to that
ESA from cherrystone was 2x faster than smartheap in the SMP tests.
ESA vs hoard and it was even greater, 10-20x faster than hoard.


It's very possible that those benchmarks may be valid, but without knowing
what methodology was used, it's equally plausible that the benchmarks could
easily be bogus or skewed or too narrowly scoped. More so if we don't know the
credentials of the company that performed them.

However, discounting hearsay, I agree that all options should be evaluated by
the OP.

Claudio Puviani
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
6518
by: Axel | last post by:
Hiho, here my Newbie question (Win32 GUI): I'm reading a file in binary mode to a char* named buffer. I used malloc(filesize) to make the needed space avaiable. The filedata in the buffer seems to be ok..I can write the variable buffer back to a file and the contents is ok. So I think until here all goes fine... But now I want write...
0
1095
by: Ryan Mack | last post by:
I'm doing development on an embedded system using a GCC 2.96 MIPS cross compiler and a minimal C standard library replacement. The system loads at startup a base executable. The base executable then loads one DLL after another during execution to reduce memory usage. The base executable statically links in a library which overrides the...
231
22932
by: Brian Blais | last post by:
Hello, I saw on a couple of recent posts people saying that casting the return value of malloc is bad, like: d=(double *) malloc(50*sizeof(double)); why is this bad? I had always thought (perhaps mistakenly) that the purpose of a void pointer was to cast into a legitimate date type. Is this wrong? Why, and what is considered to be...
9
1769
by: Momo | last post by:
i m just wondering is there any replacement of using malloc, realloc and free. Like will i able to make my our version of malloc realloc and free, if so, any idea how to do it?? any help will be good
41
3296
by: jacob navia | last post by:
In the C tutorial for lcc-win32, I have a small chapter about a debugging implementation of malloc. Here is the code, and the explanations that go with it. I would appreciate your feedback both about the code and the associated explanations. ---------------------------------------------------------------------
82
31010
by: quiberon2 | last post by:
Hi, Sorry if it might be a stupid question but what should returns malloc(0) ? void *ptr = malloc(0); I am running gcc 3.3.5 and a non-null address is returned. ( in the compiler that I am currently implementing, NULL is returned. Is it wrong ?)
25
2222
by: Why Tea | last post by:
Thanks to those who have answered my original question. I thought I understood the answer and set out to write some code to prove my understanding. The code was written without any error checking. --- #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct {
22
1928
by: ravi | last post by:
Hi all, I m relatively new to C. I have few queries related to malloc(): 1. When we perform malloc(), the memory allocated dynamically comes from the heap area of the process in concern. Well, we then say that the heap has shrinked. my query is: Is it that the heap physically does not shrink but the perticular nodes are marked...
173
7933
by: Marty James | last post by:
Howdy, I was reflecting recently on malloc. Obviously, for tiny allocations like 20 bytes to strcpy a filename or something, there's no point putting in a check on the return value of malloc. OTOH, if you're allocating a gigabyte for a large array, this might fail, so you should definitely check for a NULL return.
0
7308
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7444
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7602
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7564
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5749
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4790
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1652
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.