Sherif's Tech Blog

Just another guy on the Internet with a keyboard…

Just How Cheap Is Memory?

Well, to put it quite blatantly, computer memory has literally become cheaper than dirt. A pound of sand or mulch, costs roughly a couple of cents (depending on where you shop). A byte of memory, today, costs one-hundred-thousandsth of a penny. Which means a MiB (2^20 bytes) of memory costs just fractions more than a penny (USD) – about $0.0122 to give you an idea. So we can literally compare 2 MiB of memory to a pound of dirt (as in they have roughly the same market value for consumers).

Historically, memory was quite an expensive investment during the early days of computing. According to John C. McCallum we can see that it would have cost Millions of dollars to produce just megabytes of memory in the 1950’s (back then just one byte of memory could cost nearly $400). Today you can buy 8 gigabytes of memory at NewEgg.com for just $99.99, and this is why – the way we use computers today has changed so drastically.

Before the Internet and the commercialization of the world-wide-web we were quite comfortable storing all data locally and relying on our PCs for memory and I/O quite heavily. Today, because memory is so cheap and bandwidth costs have dropped substantially, we can store our files online and easily reproduce them on any computer at any time. The need to rely on memory is gradually decreasing as HTML5 introduces more innovative ways than ever to build online applications in ways the web was never meant for. This may not seem like we would be relying on memory less and less as more and more people are purchasing PCs, laptops, net books, and even smart phones with more and more memory today, but let’s not forget how much value we actually put on that memory today vs. 50 years ago. We value the worth of a few megabytes of memory just about as much as we do a pound of dirt. It can equally be argued, of course, that while we value greater memory capacities at a much lower price, we also rely on more memory today than ever before. The most significant difference is in what we actually use such memory for and to what gain. The heaviest consumption of consumer-grade memory is normally indicative of high resolution graphics; such as for games, digital photos, video and other media-driven desktop applications. The most common memory-hungry commercial use seems to reside in database-driven commercial applications and SaaS platforms. Even though, it is quite possible for us to do everything our day-to-day needs depend on – such as checking email, viewing and editing documents, spreadsheets, presentations, etc… – with very little memory requirements. Once we remove the bloat of eye-candy from Windows 7, the gamers-extraordinaire of Xbox 360 and PS3, and the leaky FireFox browser – we are left with very little need for memory over the long run. Lighter, faster and more portable software applications are becoming the norm for many users. Perhaps, another indication that we are steering more in the direction of SaaS and relying less and less on the SWS model.

Things like Kryder’s Law, which states that magnetic disk space doubles annually, or Moore’s Law – that depicts computing power doubling every 18 months, have demonstrated just how fast technology has been expanding over the past few decades. So by the year 2020 we will be able to purchase a Terabyte of memory for the same price we can buy 8 gigs today. Imagine how large our hard-drives will be if we can have a TiB of RAM on one computer! Today even 3TB HDDs don’t seem to be enough for some users. I know people that use several 3TB disks and still resort to external storage devices such as the cheaper USB mass storage drives or online storage space. This only demonstrates that we are becoming more and more comfortable with storing our data online (or on “the cloud” as the term has been coined). It’s not only cheaper for large corporations to purchase such massive storage space and make it readily available to the public for free (or at a small price), but it’s also safer and more convenient because they can keep backups a lot better than we can. Also, they can keep a lot better up-time than we can when they’ve learned to manage multiple state-of-the-art data-centers with exuberant redundancy measures.

The point is, we will likely still want to keep high volumes of memory locally to allow us to run graphics-savvy games and memory-hungry applications for very specific uses, but the general public will likely have little use for large amounts of memory at one time and will likely resort to more I/O dependency as I/O technology improves and provides faster reads than ever before. This also takes into account how much processing technology is developing with GPUs – for faster graphics rendering – and even more shared cache.

The Eventfulness of our Lives

Today the world is a very eventful place. Everything that is going on around us is inexplicably connected to some event at first. We have trouble easily building connections between all of the ongoing events as the world population grows profusely and time doesn’t seem to stand still for us to circulate this information quickly enough. So today we rely on technology to increase the effectiveness and efficiency of our communications. From the telephone, to the Internet, to beyond we are only as effective, in this modern society, as the tools that enable us to communicate.
The biggest challenge we’ve probably had to face so far is being able to find a way to make use of all of the information we posses with the technology we have amounted over the years. While this may seem like a trivial thing at first it is not without its trials and tribulations. As we all have come to realize by now, it makes no sense to transfer existing data and information from physical media to virtual media in order to say that we have utilized the capabilities of modern computers and their vast storage capacities. Obviously this is not a notable accomplishment. Instead, we come to realize that people will consume media in all formats. The true success story is in being able to have computers interpret or manipulate this data in a way that is useful to large groups of people. Not only that, but clearly we need to make this information easily accessible and well organized so that it may serve a diverse audience. It’s pretty clear that Google has taken on a significant portion of this effort over the years.
While having access to information in and of itself is very important, it’s also equally as important to be able to contribute information and have it become accessible to others. Thus social networking and social media, in general, has been increasingly utilized as a broadcasting mechanism for the average individual. The ability of millions of Egyptians to have their voices heard (figuratively speaking) on facebook and micro blogging web sites like twitter was a significant event to the Egyptian revolution in January of this year, for example. It was so significant, in fact, that the Egyptian government felt it was necessary to unplug virtually the entire country from the Internet so that it would not pose a further threat to the already then escalating situation. Governments all over the world are quickly realizing how much power the Internet gives people today by making information quickly and easily accessible as well as useful. China has demonstrated quite clearly that it intends to filter and control the information that it makes available to its people over the Internet by filtering web search results, blocking entire parts of the web and even specific services. Iran has either slowed social networking websites to a crawl or blocked them entirely in the past. The American government just seems to play the role of intelligence-gatherer by harnessing the Internet as a tool to keep close tabs on people.
How, day-to-day, mundane events such as “I just bought a new car…” or “Going on ski trip next week…” can be of any significance to a vast multitude of people is still unclear, but that shouldn’t stop us from making the information easily accessible to a diverse audience. We can deemphasize the information or further disassociate it from more wide-spread or significant events. Not only that, but we can even present the information in abstract as it pertains to other more specific information that we do happen to be searching for (i.e. I don’t care who is buying a new car or who is going on a ski trip, for example, but I may be interested in how many other people have also purchased the same car that I did this year or even how many people liked a particular ski resort that I am planning on visiting). It is this level of disambiguation among relational data or subsets of that data, which enables us to make information even more useful and easy to replicate and reproduce.

Just as in the case of karma systems making it easier to identify certain information as being more valuable, there can be mechanisms in place to more efficiently utilize the existing abundance of information and deliver it to the proper channels (i.e. the ones that would find it more useful).

When Will Unix Time End?

Unix time (otherwise referred to as POSIX time) will effectively be rendered unusable at precisely 3:14:08 AM UTC on January 19th of 2038.

The Y2K38 Bug!

This problem has been related to by many as the Unix equivalent of the Y2K bug (also called ‘the year 2038 problem’ or Y2K38). This bug doesn’t just depict that computer software can fail on that given date, but also before.

The problem is most notably present in 32-bit systems. Even though systems that are less than 32-bit will fail well before this date. The majority of commercial personal computer systems, like the ones you and I use, have been primarily 32-bit systems until recently. However, don’t let this alarm you as most commercial operating system software (namely, Microsoft Windows) does not normally rely on Unix Time.

Who Should be Concerned?

The ones most concerned with this catastrophe are those businesses or individuals which run *nix based servers. All flavors of Linux/Unix operating systems rely heavily on Unix time for many purposes. The problem with using POSIX time lies in the computers ability to conduct mathematical/logical operations within its address space. Having a 64-bit processor is not enough. So, the move to 64-bit operating systems has created the additional address space and interpretation necessary to make use of larger signed integers.

What is Unix Time Exactly?

The Unix Time or POSIX Time, used in *nix based operating system software, is the total number of seconds elapsed since January 1st of 1970 at midnight UTC. Since there are 86,400 seconds in a day (not accounting for leap seconds) you can see how quickly this number can grow over the years. It has been over 41 years since we started using Unix Time. Today Unix Time is represented by a signed integer of more than 1.2 Billion. This integer requires a certain number of bits in order for the operating system software, or other software on the computer, to make use of its value. Since the OS relies on hardware to be able to assign these bits to an address space this method of calculating time is limited by both physical (hardware) as well as virtual (software) capabilities of the system. If the computer is using a 64-bit process with a 64-bit OS we are able to increase the number of bits that can be used to make up an integer in our address space.

What Are the Limitations?

The limitations and inefficiencies of Unix Time are based on the fact that it uses more memory as time increases. In contrast the more human readable time that we use to distinguish dates does not increase the computers need for memory (address space) in such a linear fashion as Unix Time.

The largest possible signed integer on a 32-bit system is 2,147,483,647 which consumes a total of 31 bits of address space (31 1′s). The last bit is used to sign the integer (whether it’s positive or negative). This means we can only use up to that many seconds in a Unix time stamp on a 32-bit system (whether going back from or forward into the epoch). This equates to roughly 68 years since the epoch (the start of Unix Time in 1970).

The way we derive the largest possible integer from the number of bits is by calculating the bits (bits are either 0 or 1) to the power of number of bits used. So 2^32 = 4,294,967,296. Now, since a signed integer will use one bit we can only make use of half of this decimal representation of seconds in either direction of the epoch.

The Solution

Many solutions have been proposed to solve the year 2038 problem. One way we are attempting to solve this problem is by moving to 64-bit systems.

So, how does a 64-bit system solve our problem? In all honesty, it doesn’t. However, it does allow us to continue using Unix Time for a lot longer without having to worry about running out of address space for many – many more millenniums to come. The largest possible signed integer value on a 64-bit system is 9,223,372,036,854,775,807 [2^64 / 2] – which gives us over 292 billion more years that we can continue using Unix Time without ever worrying about running out of address space. Most likely our bones will have turned to dust by the time Unix time is no longer usable on 64-bit systems. The more likely scenario is that computers will continue to increase in compute power, virtually eliminating our need for worry.

So Why Should We Use Unix Time?

Just based on its limitations and all of its inefficiencies Unix Time doesn’t sound very appealing to us humans. However, it is very appealing to machines, which do not understand words as easily as humans. Machines understand numbers and that’s all a Unix time stamp provides. One large integer value that we can effectively use to calculate dates on a computer.

You and I can easily understand a date like January 1st of 1970, or 12/31/2010 or even 30-6-1999, but computers can not. Unix Time solves all of this for us by giving the computer something it can easily understand and work with in order to translate between human-readable and machine-readable dates. It also resolves our messy depiction of time zones as Unix Time does not care about time zone offsets.

Conclusion

So in summation, Unix Time is clearly inefficient in terms of its impact on compute power based on its linear growth. However, it effectively helps computers translate between human-to-machine readable dates and vice-versa.

Since the inception of Unix time, we have come to realize the ability for computers to process larger amounts of data at one time (per logical operation) is the caveat of using such a linear system. Though it has become evident that as such systems grow over time so does technology.

What if Machines Came to Life?

What if your refrigerator could order your groceries for you when you ran low? What if cars could drive themselves? What if machines could build things on their own? None of this is a science fiction movie! These are all real things that machines do today. It’s hard to imagine that machines could one day take over our lives in the same portrayal made by the famous blockbuster hit movie “The Matrix”, but it’s not hard to see how machines have already made us very much dependent on them today.

The idea that machines could come to life may seem ridiculous to us, but let us define life… Life, seems to be attributed only to organic material. Movies like The Transformers show how machines can come to life through some energy source, beyond our current understanding. The fiction is clear, but it’s the science that’s harder to understand. You and I, as human beings, are considered alive when our organs continue to function as they are intended. However, to say that a machine is alive would be to indulge on the notion that a machine has organs that carry out specific functions which can lead to the death of such a mechanism if and when they stop functioning.

So if electricity were considered to be such source of life to machines, as is the mysterious energy source that powers us as humans, then we could some how better analyze the confines of life to such machines. This does, however, leave us with the problem that machines are not produced through germination and offspring. They are assembled and engineered by us humans. So what happens when we engineer and assemble a machine that can produce other machines?

In May 2008 the machine, from Adrian Bowyer’s RepRap Project, succeeded in producing all of the plastic parts required to make a ‘child’ machine. This is an example of robotics that can autonomously replicate themselves. Other areas where machines have been able to successfully reproduce or produce, product from raw material, can be found in the areas of automobile manufacturing, nano technology, and aerospace industries.

Google has recently revealed it’s test findings on an automobile that can drive itself. They have been experimenting with a vehicle that is equipped with various sensors that can detect motion, speed, distance, location and many other factors that enable the car to drive itself in real life road conditions. The car has clocked 1,000 miles without any human intervention. You can read more about Google’s initiative here.

So it seems we are living in a day and age where machines coming to life is not completely absurd!

Hello World!

And so the blogging begins…

<?php
echo "Hello World!<br />";
$ideal = array("journal", "publish", "typewriter");
$conceptual = array("blog", "post", "laptop");
$txt = "I have decided to restart my journal and publish a few things online. Sorry that my site went offline for a while. I lost my typewriter and my domain expired, but luckily no one grabbed it while I was offline and I was able to re-register it and get my journal back online! I've decided to go with WordPress since it seems to be all the rage these days.";
$intro = str_ireplace($ideal, $conceptual, $txt);
echo $intro;
// Output:
/*
Hello World!
I have decided to restart my blog and post a few things online. Sorry that my site went offline for a while. I lost my laptop and my domain expired, but luckily no one grabbed it while I was offline and I was able to re-register it and get my blog back online! I've decided to go with WordPress since it seems to be all the rage these days.
*/
?>

I thought I’d start things off by posting this Hello World php script. Just click here if you’d like to actually try it yourself. Thanks!