Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > a problem about windows memory

Reply
Thread Tools

a problem about windows memory

 
 
richi
Guest
Posts: n/a
 
      09-25-2008
Hi everyone,

I am sorry, my english is not good!

I found a problem about memory. In a function I malloced more memory than
before
that is 4.5625Kb in theory. Then I watched the memory size of the function
in Linux and
Unix through the command of "ps". After comparing with the early memory
size of
the function which didn't have change, I found the increaseded size was
different! In Linux and Unix
the size is about 4Kb, but in windows the size watched from task manager is
far more
than 4Kb.

can anyone help me and explain the phenomenon,please?

 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      09-25-2008
richi wrote:
> Hi everyone,
>
> I am sorry, my english is not good!
>
> I found a problem about memory. In a function I malloced more memory
> than before
> that is 4.5625Kb in theory. Then I watched the memory size of the
> function in Linux and
> Unix through the command of "ps". After comparing with the early memory
> size of
> the function which didn't have change, I found the increaseded size was
> different! In Linux and Unix
> the size is about 4Kb, but in windows the size watched from task manager
> is far more
> than 4Kb.
>
> can anyone help me and explain the phenomenon,please?
>


Probably under linux your memory is just reserved, not really allocated
until you try to use it. Under windows, probably more memory is
allocated right away.


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      09-25-2008
jacob navia wrote:
> richi wrote:
>> Hi everyone,
>>
>> I am sorry, my english is not good!
>>
>> I found a problem about memory. In a function I malloced more memory
>> than before
>> that is 4.5625Kb in theory. Then I watched the memory size of the
>> function in Linux and
>> Unix through the command of "ps". After comparing with the early memory
>> size of
>> the function which didn't have change, I found the increaseded size was
>> different! In Linux and Unix
>> the size is about 4Kb, but in windows the size watched from task manager
>> is far more
>> than 4Kb.
>>
>> can anyone help me and explain the phenomenon,please?


Try asking on comp.unix.programmer. How the OS manages memory is
platform specific.

> Probably under linux your memory is just reserved, not really allocated
> until you try to use it. Under windows, probably more memory is
> allocated right away.


Linux can do this, but Unix versions tend not to. The OP doesn't say
which one was used.

--
Ian Collins.
 
Reply With Quote
 
richi
Guest
Posts: n/a
 
      09-25-2008
thank for your answer !
but I had tried hunderds of times, and the result is the same.
Under Linux and HP-Unix, the increased memory size was about 4Kb at all
times
But Under Windows the increased was not fixed, e.g. 4Kb, 8Kb, 16Kb.
I don't know why! Does it probably relate to the page size of operating
system?


"jacob navia" <(E-Mail Removed)> wrote in message
news:gbfkp2$i8t$(E-Mail Removed)...
> richi wrote:
>> Hi everyone,
>>
>> I am sorry, my english is not good!
>>
>> I found a problem about memory. In a function I malloced more memory
>> than before
>> that is 4.5625Kb in theory. Then I watched the memory size of the
>> function in Linux and
>> Unix through the command of "ps". After comparing with the early memory
>> size of
>> the function which didn't have change, I found the increaseded size was
>> different! In Linux and Unix
>> the size is about 4Kb, but in windows the size watched from task manager
>> is far more
>> than 4Kb.
>>
>> can anyone help me and explain the phenomenon,please?
>>

>
> Probably under linux your memory is just reserved, not really allocated
> until you try to use it. Under windows, probably more memory is
> allocated right away.
>
>
> --
> jacob navia
> jacob at jacob point remcomp point fr
> logiciels/informatique
> http://www.cs.virginia.edu/~lcc-win32


 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      09-25-2008
richi wrote:

[Please don't top post]

> "jacob navia" <(E-Mail Removed)> wrote in message
> news:gbfkp2$i8t$(E-Mail Removed)...
>> richi wrote:
>>> Hi everyone,
>>>
>>> I am sorry, my english is not good!
>>>
>>> I found a problem about memory. In a function I malloced more memory
>>> than before
>>> that is 4.5625Kb in theory. Then I watched the memory size of the
>>> function in Linux and
>>> Unix through the command of "ps". After comparing with the early memory
>>> size of
>>> the function which didn't have change, I found the increaseded size was
>>> different! In Linux and Unix
>>> the size is about 4Kb, but in windows the size watched from task manager
>>> is far more
>>> than 4Kb.
>>>
>>> can anyone help me and explain the phenomenon,please?
>>>

>>
>> Probably under linux your memory is just reserved, not really allocated
>> until you try to use it. Under windows, probably more memory is
>> allocated right away.
>>

> thank for your answer !
> but I had tried hunderds of times, and the result is the same.
> Under Linux and HP-Unix, the increased memory size was about 4Kb at all
> times
> But Under Windows the increased was not fixed, e.g. 4Kb, 8Kb, 16Kb.
> I don't know why! Does it probably relate to the page size of operating
> system?
>

Could be, try an OS group, you'll get more sense there.

>> --
>> jacob navia
>> jacob at jacob point remcomp point fr
>> logiciels/informatique
>> http://www.cs.virginia.edu/~lcc-win32

>

Please don't quote signature blocks.

--
Ian Collins.
 
Reply With Quote
 
richi
Guest
Posts: n/a
 
      09-25-2008
thanks for your advice!
"Ian Collins" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> jacob navia wrote:
>> richi wrote:
>>> Hi everyone,
>>>
>>> I am sorry, my english is not good!
>>>
>>> I found a problem about memory. In a function I malloced more memory
>>> than before
>>> that is 4.5625Kb in theory. Then I watched the memory size of the
>>> function in Linux and
>>> Unix through the command of "ps". After comparing with the early memory
>>> size of
>>> the function which didn't have change, I found the increaseded size was
>>> different! In Linux and Unix
>>> the size is about 4Kb, but in windows the size watched from task manager
>>> is far more
>>> than 4Kb.
>>>
>>> can anyone help me and explain the phenomenon,please?

>
> Try asking on comp.unix.programmer. How the OS manages memory is
> platform specific.
>
>> Probably under linux your memory is just reserved, not really allocated
>> until you try to use it. Under windows, probably more memory is
>> allocated right away.

>
> Linux can do this, but Unix versions tend not to. The OP doesn't say
> which one was used.
>
> --
> Ian Collins.


 
Reply With Quote
 
richi
Guest
Posts: n/a
 
      09-25-2008
Sorry. I am a new fish here!

What is the meaning of ~top post~?

How to avoid ~top post~?
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      09-25-2008
richi wrote:
>
> I am sorry, my english is not good!
>
> I found a problem about memory. In a function I malloced more
> memory than before that is 4.5625Kb in theory. Then I watched the

....

Please explain how you can allocate 1/2 a byte. Either in practice
or in theory.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      09-25-2008
richi wrote:
>
> Sorry. I am a new fish here! What is the meaning of ~top post~?
> How to avoid ~top post~?


Please do not top-post. Your answer belongs after (or intermixed
with) the quoted material to which you reply, after snipping all
irrelevant material. See the following links:

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/> (taming google)
<http://members.fortunecity.com/nnqweb/> (newusers)

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
 
Reply With Quote
 
Ben Bacarisse
Guest
Posts: n/a
 
      09-25-2008
CBFalconer <(E-Mail Removed)> writes:

> richi wrote:
>>
>> I am sorry, my english is not good!
>>
>> I found a problem about memory. In a function I malloced more
>> memory than before that is 4.5625Kb in theory. Then I watched the

> ...
>
> Please explain how you can allocate 1/2 a byte. Either in practice
> or in theory.


Why do you think the OP is claiming that? (4672 is exactly 4.5625Kb
using the usual computer meaning of K.)

--
Ben.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
total memory available is only 3.3GB with 4GB physical memory under windows 7 64 bit someone@somewhere.com Windows 64bit 6 05-18-2010 10:46 AM
total memory available is only 3.3GB with 4GB physical memory under windows 7 64 bit someone@somewhere.com Windows 64bit 19 01-12-2010 10:33 AM
memory/time problem, windows authentication for a asp.net web service leo_junquera@hotmail.com ASP .Net 3 09-30-2005 01:56 PM
Differences between Sony Memory Stick & memory Stick Pro vs Memory Stick Duo? zxcvar Digital Photography 3 11-28-2004 10:48 PM
Problem with memory when using "threads" with Perl 5.8 on Windows System Gavin Williams Perl 0 06-24-2004 06:09 PM



Advertisments