Page 1 of 2

Is paging obsolete

Posted: Fri Jul 03, 2009 5:31 pm
by dude101
With modern computers coming with 4+ gigs of RAM, has paging become obsolete?

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 5:46 pm
by yemista
NOOO!!!!!!! PAGING MAKES THE WORLD GO ROUND!!!!!

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 5:47 pm
by NickJohnson
What can you possibly mean by that? Even if all of the physical memory area is filled (even though it's not, even if you have 4 GB of RAM, because of ACPI tables and such), you don't get the protection and flexibility of paging. It's much much easier to implement multiple processes if they can be completely separated and think they are at the same memory addresses. And with 64 bit systems, having 4 GB of RAM is barely anything compared to the full address space. Unless you have a mechanism that is better than paging for virtual memory management, paging is the best thing out there, and virtual memory is really important. I'm guessing you haven't written a real memory manager yet, or you wouldn't ask this.

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 5:49 pm
by yemista
I just thought about it again, and hes gotta mean swapping, thats why he brought up the 4gb, because with so much RAM swapping is a lot less necessary. Read up on virtual address spaces, paging and swapping so you can be a little more clear on your question

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 6:09 pm
by NickJohnson
I would agree partially that *swapping* is obsolete, at least in some cases. I'm not planning to implement it on my OS for quite a while, and I've configured it out of my Linux system entirely. But for servers, it can be quite useful. And the way software seems to be headed, no amount of memory will really ever be enough (soon enough, it will be eight GIGs and constantly swapping :lol: ).

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 6:14 pm
by dude101
NickJohnson wrote:I would agree partially that *swapping* is obsolete, at least in some cases. I'm not planning to implement it on my OS for quite a while, and I've configured it out of my Linux system entirely. But for servers, it can be quite useful. And the way software seems to be headed, no amount of memory will really ever be enough (soon enough, it will be eight GIGs and constantly swapping :lol: ).

You can thank bloated virtual machines and lazy programmers for that.

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 7:16 pm
by yemista
Whatever the case, its all made possible by paging \:D/
But to better answer your question, it is not obsolete, paging is just a concept for creating virtual addresses. In can be implemented differently on different architectures, but the core idea remains the same. You are interpretting an address as a list of tables that describes how you can access that address, and where it resides in physical memory

Re: Is paging obsolete

Posted: Fri Jul 03, 2009 7:56 pm
by Brynet-Inc
A swap/page partition/file is not obsolete, neither is paging.. systems that lack both concepts are obsolete.

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 2:42 am
by Combuster
Desktop systems that lack strong memory protection or swapping are obsolete. With paging leading the memory protection market.

No paging or memory protection needed on f.x. a Nintendo Wii :wink:

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 9:12 am
by Brynet-Inc
Combuster wrote:No paging or memory protection needed on f.x. a Nintendo Wii :wink:
Those are toys, not computers.. they're probably the only exception for a shitty operating system.

Although, don't most of those systems have browsers now? without paging or memory protection.. some malicious Goomba could steal your shrooms.

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 11:19 am
by Colonel Kernel
The way I see it, as developers we'd love to be able to at least pretend that we have infinite memory. Designing systems that can tolerate low-memory conditions is really, really hard.

With virtual memory and 64-bit address spaces, we can basically pretend that we have an infinite amount of address space, which is convenient. But without swapping, the physical memory limitation stays and the degree of multitasking the user can do goes down accordingly. Lots of stuff is hardly ever used and not needed in memory for the long term anyway (e.g. -- app initialization code)... Why give up the ability of the OS to leave it on disk for you?
dude101 wrote:You can thank bloated virtual machines and lazy programmers for that.
:roll:

There are plenty of systems written in unmanaged code by very hard-working programmers that still consume way too much memory. There are a lot of reasons why software turns out the way it does, most of them due to organizational behaviour, economics, and human psychology. Insulting most of the world's developers is offensive and a huge oversimplification.

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 3:11 pm
by mathematician
NickJohnson wrote:I would agree partially that *swapping* is obsolete, at least in some cases. I'm not planning to implement it on my OS for quite a while, and I've configured it out of my Linux system entirely. But for servers, it can be quite useful. And the way software seems to be headed, no amount of memory will really ever be enough (soon enough, it will be eight GIGs and constantly swapping :lol: ).
Don't forget that in the early eighties a top of the range home computer had 64kb of memory - max. Then the PC came on the market with a maximum 1mb of memory, and nobody could imagine how anybody could ever fill it up. Then, when 32 bit processors came along, it was more than obvious that PCs would never have 4gb of memory inside them. A PC isn't a Cray, you know. And now we have 64 bit processors, and everybody is saying.......

If history has anything to teach, it is that nothing in the world of computing is too extravagent to come true. Would you want to take a bet that, twenty years from now, somebody won't be complaining because the processor in their PC only has measly 1024 cores?

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 5:19 pm
by gravaera
Colonel Kernel wrote:
dude101 wrote:You can thank bloated virtual machines and lazy programmers for that.
:roll:

There are plenty of systems written in unmanaged code by very hard-working programmers that still consume way too much memory. There are a lot of reasons why software turns out the way it does, most of them due to organizational behaviour, economics, and human psychology. Insulting most of the world's developers is offensive and a huge oversimplification.
No. I think he was really referring to the Horde of UniMonkeys. Those people who learned most of what they know about computing at Uni, and studied really really hard, and struggled to understand (ZOMG!! WTF is a POINTER???:?:) basic concepts, working hard to 'pass' exams, and then come out after three years believing they are 'Programmers'. You know the type: "Oh my god!! Why the hell do they use Hexadecimal so much when we have Decimal???? GAAAAAAAAAH"

And the classic: "Wow. What's the difference between using an array and a Linked list?"

They get 'training' to 'get a job'. By the way: If you identify with that, then, yes. You ARE a UniMonkey. A generic object spawned every three years by some institute's random-patterned engine.

Yup. Those kinds really are to blame. They don't understand **** about what they're programming. I mean: you see whole TEAMS of 'Programmers' (UniMonkeys) assigned to do a simple File Handling Module for a program.

Something a kid could do in a day. They are assigned a 'Project Manager', who gives them a week to do it. I mean...how incompetent.

And it's STILL inefficient. And in your post you defended a 'Hard Working Programmer', saying that their code can still come out below the mark in tpite of their hard work; Listen: Hard work doesn't cut it. A UniMonkey tries to implement a simple function, and doesn't understand the intricacies of the language. They think so statically.

Let me give you an example:

Code: Select all

//A REAL programmer's implementation:
int strlen(register const char *str)
{
   register unsigned int i=0; // Increase speed of constantly used function.
   while(str[i++]){}; //Preserve the address of str. The user will most likely need it after.
   return i;
};

//A UniMonkey...
int strlen(const char *str)
{
   int len; //(1)
   while(str++ != '\0') //(2)
   {
      len++; //(3)
   }
   return len; //Here's the irritating part. He'll argue that: "But...it works."
};
(1)Uninitialized local variable. Smart. Yeah. So the garbage from the stack is just in there, waiting to cause undefined behaviour. Brilliant. Of course, he doesn't even know what the stack is. Nah. He thinks that he's dealing with a memory location. Of course.

(2) The fool just learned last week that Arrays in C/C++ are really just pointers. So, hey, "I can just advance the pointer!"

(3)He is doing TWO increments on each loop, for NO REASON.

/*"But it works!". No, it doesn't. It modifies the pointer. And even if it did, that's not the point, you idiot. (1) The function modifies the pointer, and therefore causes unforeseen effects, (2) It's half as fast as a proper implementation should be, (3) your overall style of absolutely n00bish coding is going to be reflected in every function, and line of code you write. 

This may not seem so big right now, but this function is going to be called by everyone on the team. They'll take about a week to realize (UniMonkeys) that the reason they keep getting strange output is because their pointers are advanced beyond their bounds, and then not even notice that your code is inefficient.
A Hard working UniMonkey lacks the pure logical mindset to see the little stuff. Universities don't teach how to write efficient code. They teach you that "#include" is meant to help you, and that C++ is really good for development, and it has a fast library. And they give you some small "exercises" to do to get the "solutions' to specifications. But what about:

(1)Code speed
(2)Code SANITY
and (3)Code memory efficiency?

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 5:42 pm
by JohnnyTheDon
Actually modifying the pointer would have no effect in C/C++ because a copy of the pointer is made for the call. Thats why you can't just do

Code: Select all

void swap(char* a,char* b)
{
  char* temp = a;
  a = b;
  b = temp;
}
to swap variables, because it will have no effect on the original a and b from the caller.
Also the first strlen() should have 'const char* const str' as the parameter so the pointer value is constant as well as what it points to. But thats just being a const nazi :)

Re: Is paging obsolete

Posted: Sat Jul 04, 2009 6:04 pm
by gravaera
:D But you get my drift. I don't think Universities are turning out the best produce. I started my day job the Wednesday of th eweek before (my first job 8) ) and I'm working on a dev team for a Programming Company called Illuminat, and receiving 3/4 the wages of the other guys since I'm 17. but already the Project Manager is asking my opinion and stuff for the projects they work on.

The other guys in there make the most stupid mistakes in their code. I mean: honestly: big men, and they can't understand that "Okay, you don't need separate arrays for sotring client names because we have structures."

They actually think that structs are only used when contructing linked lists. But they "don't use those, cos they're too time consuming, and arrays are better. You just use the index variable on all the different arrays."

So a customer's data is stored as arrays of name, age, address, etc separately.

I mean: the first time I saw something like that, I was confused. I actually looked over the code three times, to make sure I wasn't just missing something. I was like: "I can't possible be seeing this."

But no. There it was.