Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Many alligators will be slain, but the swamp will remain.


devel / comp.os.ms-windows.programmer.win32 / Re: Memory Leak problem while using MapViewOfFile

SubjectAuthor
* Re: Memory Leak problem while using MapViewOfFileRavindra Panchal
`- Re: Memory Leak problem while using MapViewOfFileJJ

1
Re: Memory Leak problem while using MapViewOfFile

<bd3ac3a9-b85e-442e-9bbe-5d3c49eb8aben@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=386&group=comp.os.ms-windows.programmer.win32#386

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
X-Received: by 2002:a05:6214:21a7:b0:441:1434:eafd with SMTP id t7-20020a05621421a700b004411434eafdmr6202413qvc.77.1649238538917;
Wed, 06 Apr 2022 02:48:58 -0700 (PDT)
X-Received: by 2002:ac8:5ad6:0:b0:2e2:27b6:7b3e with SMTP id
d22-20020ac85ad6000000b002e227b67b3emr6969854qtd.216.1649238538703; Wed, 06
Apr 2022 02:48:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.ms-windows.programmer.win32
Date: Wed, 6 Apr 2022 02:48:58 -0700 (PDT)
In-Reply-To: <fnZaNOF51XL9EwF+@objmedia.demon.co.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=183.83.137.209; posting-account=rK6QXQoAAADJ_a_H8i-VQOidePL2gb3P
NNTP-Posting-Host: 183.83.137.209
References: <b5a71bcf.0207110231.7dfb0fb6@posting.google.com> <fnZaNOF51XL9EwF+@objmedia.demon.co.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bd3ac3a9-b85e-442e-9bbe-5d3c49eb8aben@googlegroups.com>
Subject: Re: Memory Leak problem while using MapViewOfFile
From: ravindra.d.panchal@gmail.com (Ravindra Panchal)
Injection-Date: Wed, 06 Apr 2022 09:48:58 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Ravindra Panchal - Wed, 6 Apr 2022 09:48 UTC

same issue with my app. Have you got any clue on this memory leak, how to resolve ?

On Thursday, July 11, 2002 at 6:13:37 PM UTC+5:30, Stephen Kellett wrote:
> In message <b5a71bcf.02071...@posting.google.com>, baskar
> <cbas...@yahoo.co.in> writes
> >Hi,
> > Using the following code to access the shared memory.
> >
> >*****************************************
> >Object *dcM;
> >dcM = (Object *) MapViewOfFile(hMapFile, // Handle to mapping object.
> >FILE_MAP_ALL_ACCESS, // Read/write permission
> >0, // Max. object size.
> >0, // Size of hFile.
> >0); // Map entire file.
> >dcM[0].method1() //Memory leak occors here
> >*****************************************
> >Memory leak is occuring while calling method1. Need I to do anything to
> >handle this.
> People usually want to fix their memory leaks.
> A good tool for identifying and fixing memory leaks is Memory Validator.
> A 30 day evaluation can be found at http://www.softwareverify.com
> Regards
> Stephen
> --
> Stephen Kellett http://www.objmedia.demon.co.uk
> Object Media Limited C++/Java/Windows NT/Unix/X Windows/Multimedia
> If you are suffering from RSI, contact me for advice.
> Unsolicited email from spam merchants not welcome.

Re: Memory Leak problem while using MapViewOfFile

<11mnupm5lzbd0$.b8lklqgiejby$.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=387&group=comp.os.ms-windows.programmer.win32#387

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: Memory Leak problem while using MapViewOfFile
Date: Wed, 6 Apr 2022 22:15:39 +0700
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <11mnupm5lzbd0$.b8lklqgiejby$.dlg@40tude.net>
References: <b5a71bcf.0207110231.7dfb0fb6@posting.google.com> <fnZaNOF51XL9EwF+@objmedia.demon.co.uk> <bd3ac3a9-b85e-442e-9bbe-5d3c49eb8aben@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="d22c61f7feacdf0b387bed4a44c42ef0";
logging-data="13021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VmeaeSxd9hzKgJNOkRh8/1Nq/vQijQ1A="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:V/YFtdpFxjy77Ih5Lh0aEhAp8wQ=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Wed, 6 Apr 2022 15:15 UTC

On Wed, 6 Apr 2022 02:48:58 -0700 (PDT), Ravindra Panchal wrote:
> same issue with my app. Have you got any clue on this memory leak, how to resolve ?
>
> On Thursday, July 11, 2002 at 6:13:37 PM UTC+5:30, Stephen Kellett wrote:
>> In message <b5a71bcf.02071...@posting.google.com>, baskar
>> <cbas...@yahoo.co.in> writes
>>>Hi,
>>> Using the following code to access the shared memory.
>>>
>>>*****************************************
>>>Object *dcM;
>>>dcM = (Object *) MapViewOfFile(hMapFile, // Handle to mapping object.
>>>FILE_MAP_ALL_ACCESS, // Read/write permission
>>>0, // Max. object size.
>>>0, // Size of hFile.
>>>0); // Map entire file.
>>>dcM[0].method1() //Memory leak occors here
>>>*****************************************
>>>Memory leak is occuring while calling method1. Need I to do anything to
>>>handle this.

It's not a memory leak. It's how mapped memory work.

The system does not initially allocate any memory. Only the address space.
The system will dynamically allocate memory (in pages) as data is read/write
from/to it. So, the more data is read/write from/to different part of the
mapped memory, the more memory would actually be allocated. If all parts of
the mapped memory is read, the system would end up allocating memory as
large as the entire source of the mapped memory. IOTW, the system would only
allocate memory as needed, and won't deallocate them until the mapped memory
is destroyed.

Mapped memory works similar to NTFS Sparse files in terms of storage space
allocation. e.g. if a new 10MB sparse file is created without writing
anything into it, it won't consume any storage space. It'll only consume
storage space (in clusters) when a data is actually written into it. e.g. if
the NTFS cluster size is 4K, and 1K data is written at start and at end of
the file, the file would only consume 8K of storage space.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor