Sample output for memory management program

INPUT (input.txt):
กก

8192
A 9000 1
A 234 1
A 458 2
A 30 3
D 1
P
A 7471 5
A 7471 2
A 100 2
D 5
A 890 4
D 3
P
A 70 5
A 30 6
P
A 6600 7
P
D 2
P
D 5
P
D 4
P

**Note: In the above input file, the first number '8192' means the total memory space is 8192 bytes, 'A 234 1' means allocate 234 bytes to process 1, 'D 1' means delete process 1, 'P' means print out memory status.

*****************************

Best Fit w/o compact

*****************************

กก

OUTPUT:
-----------

8192
A
9000 1
Error: Memory exceeds available free memory.
8192
A
234 1
A
458 2
A
30 3
D
1
P
Memory size = 8192 bytes, allocated bytes = 488, free = 7704
There're currently 2 holes and 2 processes:
Hole list:
hole 1: start location=0, size=234
hole 2: start location=722, size=7470
Process list:
process 1: id=2, start location=234, size=458
process 2: id=3, start location=692, size=30
A

7471 5

Error: Memory not available due to external fragmentation, can't allocate memory space to process 5

A
7471 2
Error: Process already exists
A
100 2
Error: Process already exists
D
5
Error: Process not in memory
A
890 4
D
3
P
Memory size = 8192 bytes, allocated bytes = 1348, free = 6844
There're currently 3 holes and 2 processes:
Hole list:
hole 1: start location=0, size=234
hole 2: start location=692, size=30
hole 3: start location=1612, size=6580
Process list:
process 1: id=2, start location=234, size=458
process 2: id=4, start location=722, size=890
A
70 5
A
30 6
P
Memory size = 8192 bytes, allocated bytes = 1448, free = 6744
There're currently 2 holes and 4 processes:
Hole list:
hole 1: start location=70, size=164
hole 2: start location=1612, size=6580
Process list:
process 1: id=2, start location=234, size=458
process 2: id=4, start location=722, size=890
process 3: id=5, start location=0, size=70
process 4: id=6, start location=692, size=30
A
6600 7
Error: Memory not available due to external fragmentation, can't allocate memory space to process 7
P
Memory size = 8192 bytes, allocated bytes = 1448, free = 6744
There're currently 2 holes and 4 processes:
Hole list:
hole 1: start location=70, size=164
hole 2: start location=1612, size=6580
Process list:
process 1: id=2, start location=234, size=458
process 2: id=4, start location=722, size=890
process 3: id=5, start location=0, size=70
process 4: id=6, start location=692, size=30
D
2
P
Memory size = 8192 bytes, allocated bytes = 990, free = 7202
There're currently 2 holes and 3 processes:
Hole list:
hole 1: start location=70, size=622
hole 2: start location=1612, size=6580
Process list:
process 1: id=4, start location=722, size=890
process 2: id=5, start location=0, size=70
process 3: id=6, start location=692, size=30
D
5
P
Memory size = 8192 bytes, allocated bytes = 920, free = 7272
There're currently 2 holes and 2 processes:
Hole list:
hole 1: start location=0, size=692
hole 2: start location=1612, size=6580
Process list:
process 1: id=4, start location=722, size=890
process 2: id=6, start location=692, size=30
D
4
P
Memory size = 8192 bytes, allocated bytes = 30, free = 8162
There're currently 2 holes and 1 processes:
Hole list:
hole 1: start location=0, size=692
hole 2: start location=722, size=7470
Process list:
process 1: id=6, start location=692, size=30