CST 334 - Week 3

 The main topics this week involved memory allocation as well as some regular expression and awk scripts.  First memory can be virtualized.  In order for a program to run it must be loaded from the disk into RAM generating a process address space.  The program does not get access to the entire memory though.  It only gets access to available memory and only the amount it needs.  This process is controlled through the OS Memory Management system.  The OS Memory Management system provides an illusion to the program that it is accessing the entirety of the physical memory in a system.  Each process has a set illusion address space that it thinks is the entire memory.  This allows for multi-programming on a system because not one process can use all of the memory.  When the program is transferred from this illusion address space, logical address, to the physical address on the actual memory it is referred to as program relocation.  There is also a memory API that programmers have access to control how memory is allocated and de-allocated.  The malloc() function is a function that allocated a memory region on the heap, with its argument being the size, in bytes, that is needed.  This function will return the pointer to the address location.  To then de-allocate this space, the free() function is used with its argument being the address pointer.

Some studies into grep, awk, and regular expression were also done this week.  Awk scripts can be extremely powerful in manipulating data in a file.  The awk expression uses a pattern to locate lines that match that pattern and then perform a rule/manipulation to that data as defined in the script by the programmer.  This can be helpful in making a csv more readable, performing calculations on data in a table, or even processing a process log to only show the desired data such as runtime or crashes.  The grep command is much like the awk without the manipulation.  It will filter its input against matches in the provided pattern.  Both the awk and grep commands use regular expression format to define the pattern.

Comments

Popular posts from this blog

CST 499 - Week 10

CST 438 - Week 7

CST 438 - Week 3