BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

.NET and sharing dll's?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical
View previous topic :: View next topic  
Author Message
Arthur Hoornweg
Guest





PostPosted: Tue Dec 21, 2004 8:40 am    Post subject: .NET and sharing dll's? Reply with quote



Don't know in which group to post this, since it has
neither to do with the .net API itself nor with any
Borland programming language, but a colleague told me
that under .NET managed DLL's aren't shared in virtual
memory among applications (each app gets its own copy
which is not good for memory footprint).

I find that somehow hard to imagine, at least in Win32
the DLL/memory mapped file mechanism is certainly one
of the greatest features that increases performance.
Giving all that up doesn't seem like a good idea.

I would be interested to know whether it is true or not!




--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)
Back to top
Marc Rohloff [TeamB]
Guest





PostPosted: Tue Dec 21, 2004 1:19 pm    Post subject: Re: .NET and sharing dll's? Reply with quote



On Tue, 21 Dec 2004 09:40:10 +0100, Arthur Hoornweg wrote:

Quote:
I would be interested to know whether it is true or not!

I was under the impression that the DLLs where normally shared however
none of the JITted code is shared and this is where you will get the
larger memory hit.

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Back to top
Arthur Hoornweg
Guest





PostPosted: Tue Dec 21, 2004 3:21 pm    Post subject: Re: .NET and sharing dll's? Reply with quote



Marc Rohloff [TeamB] wrote:

Quote:
I was under the impression that the DLLs where normally shared however
none of the JITted code is shared and this is where you will get the
larger memory hit.

That's exactly what I meant (user-developed DLL's, written in
managed code, not being shared in memory).


Can this be avoided by putting them in the GAC?




--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)

Back to top
Bob
Guest





PostPosted: Tue Dec 21, 2004 5:06 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

If I'm not mistaken, thats exacly how win32 does it as well. DLLs memory
space are not shared across processes.

"Arthur Hoornweg" <antispam.hoornweg (AT) casema (DOT) nl.net> wrote

Quote:
Don't know in which group to post this, since it has
neither to do with the .net API itself nor with any
Borland programming language, but a colleague told me
that under .NET managed DLL's aren't shared in virtual
memory among applications (each app gets its own copy
which is not good for memory footprint).

I find that somehow hard to imagine, at least in Win32
the DLL/memory mapped file mechanism is certainly one
of the greatest features that increases performance.
Giving all that up doesn't seem like a good idea.

I would be interested to know whether it is true or not!




--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)



Back to top
Arthur Hoornweg
Guest





PostPosted: Tue Dec 21, 2004 8:32 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

Bob wrote:

Quote:
If I'm not mistaken, thats exacly how win32 does it as well. DLLs memory
space are not shared across processes.

The "code" memory is shared, the "data" memory (heap, stack,
data segment) isn't.

Each process has its own separate logical address space,
of course, but a DLL is opened as a "memory mapped file".
This MMF can then be "mapped" into physical memory (in
"pages" of 4 kb). These pages can then be mapped into
the logical addres spaces of the processes.



--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)

Back to top
Marc Rohloff [TeamB]
Guest





PostPosted: Wed Dec 22, 2004 1:45 am    Post subject: Re: .NET and sharing dll's? Reply with quote

On Tue, 21 Dec 2004 21:32:16 +0100, Arthur Hoornweg wrote:

Quote:
The "code" memory is shared, the "data" memory (heap, stack,
data segment) isn't.

Except that for .NET the 'code' is onyl the IL not the JITted ASM
code.

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Back to top
Arthur Hoornweg
Guest





PostPosted: Wed Dec 22, 2004 7:40 am    Post subject: Re: .NET and sharing dll's? Reply with quote

Marc Rohloff [TeamB] schreef:

Quote:
Except that for .NET the 'code' is onyl the IL not the JITted ASM
code.

So if I startup the same app ten times, it is JITted 10 times?



--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)

Back to top
Andrea Raimondi
Guest





PostPosted: Wed Dec 22, 2004 9:15 am    Post subject: Re: .NET and sharing dll's? Reply with quote

Arthur Hoornweg wrote:
Quote:
So if I startup the same app ten times, it is JITted 10 times?

As I understand it, yes. And it occupies 10 times the memory.

Cheers,

Andrew
--
Online thoughts blog
http://araimondi.blogspot.com

Back to top
Marc Rohloff [TeamB]
Guest





PostPosted: Wed Dec 22, 2004 1:05 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

On Wed, 22 Dec 2004 10:15:03 +0100, Andrea Raimondi wrote:

Quote:
So if I startup the same app ten times, it is JITted 10 times?

As I understand it, yes. And it occupies 10 times the memory.

And just wait till .NET 2.0 becomes mainstream. If you think
performance is bad now wait till you have two CLRs loaded.

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Back to top
Arthur Hoornweg
Guest





PostPosted: Wed Dec 22, 2004 1:07 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

Andrea Raimondi schreef:

Quote:
As I understand it, yes. And it occupies 10 times the memory.

Kinda makes me wonder. If the app is JITted 10 times, the
outcome will be the same 10 times.
IMHO, it would have been more clever to JIT it only once
(at install time, applying all CPU optimizations etcetera)
and store the outcome as native code. Or at least to cache
the result permanently.
Nothing against managed code, but performing the same
time-consuming task over and over again for no good reason
is a waste of resources.

Come to think of it, is it true that MSIL code is pre-compiled
when you put it into the GAC? That might be a way to overcome
this dilemma.






--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)

Back to top
Mauro Venturini
Guest





PostPosted: Wed Dec 22, 2004 5:08 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

ngen.exe is there to be used. It does axactly that: compile an assembly and
cache it (until a new version appears).

"Arthur Hoornweg" <antispam.hoornweg (AT) casema (DOT) nl.net> wrote

Quote:
Andrea Raimondi schreef:

As I understand it, yes. And it occupies 10 times the memory.

Kinda makes me wonder. If the app is JITted 10 times, the
outcome will be the same 10 times.
IMHO, it would have been more clever to JIT it only once
(at install time, applying all CPU optimizations etcetera)
and store the outcome as native code. Or at least to cache
the result permanently.
Nothing against managed code, but performing the same
time-consuming task over and over again for no good reason
is a waste of resources.

Come to think of it, is it true that MSIL code is pre-compiled
when you put it into the GAC? That might be a way to overcome
this dilemma.






--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)



Back to top
Eric Grange
Guest





PostPosted: Wed Dec 22, 2004 5:21 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

Quote:
Kinda makes me wonder. If the app is JITted 10 times, the
outcome will be the same 10 times.

Theoretically not, since some of the library functions
could be inlined in one case, not in another f.i., and some
may not be JITted at all in some cases (because never used
in those cases), etc.
This has the potential to get even more spectacular with
generics: the same bit of code can get jitted into gazillions
of typesafe variants... or none at all. Thus the same DLL
could end up eating anything from a few kilobytes to several
megabytes.

Eric

Back to top
Arthur Hoornweg
Guest





PostPosted: Wed Dec 22, 2004 6:43 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

Mauro Venturini schreef:
Quote:
ngen.exe is there to be used. It does axactly that: compile an assembly...


OK! That should do the trick.

Would there be any reason NOT to use this tool on large
applications where speed is important?






--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)

Back to top
Nick Hodges [TeamB]
Guest





PostPosted: Wed Dec 22, 2004 7:11 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

Arthur Hoornweg wrote:

Quote:
Would there be any reason NOT to use this tool on large
applications where speed is important?

Yes -- because it has no idea abou the platform upon with the resulting
EXE will be run, NGEN produces less efficient code than the JIT
compiler.

--
Nick Hodges -- TeamB
Lemanix Corporation -- http://www.lemanix.com
Read my Blog -- http://www.lemanix.com/nick

Back to top
sun
Guest





PostPosted: Wed Dec 22, 2004 10:34 pm    Post subject: Re: .NET and sharing dll's? Reply with quote

"Nick Hodges [TeamB]" <nickhodges (AT) gmail (DOT) com> wrote:

Quote:
Arthur Hoornweg wrote:

Would there be any reason NOT to use this tool on large
applications where speed is important?

Yes -- because it has no idea abou the platform upon with the resulting
EXE will be run, NGEN produces less efficient code than the JIT
compiler.

AFAIK ngen and JIT compiler uses the same compiler just in different
modes and also both run on target machine (as opposite to developer
machine) so there should be no performance issues from this point of view.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Non-Technical All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.