Virtual Memory Question

  • Thread starter rootX
  • Start date
  • #1
378
2
If there is a 1024x1024 array of 32 bits numbers and we need to normalize by columns.

Algorithm goes through each column, finds max and divide all numbers by the max.
It would be certainly wise to store the pages by column?

My rationale:
1M (2^20) main memory is allocated and each page is 4K bytes as provided.

Because if it is done by rows, 256 rows will be stored. So, for each column there will be 3 page faults when reading numbers and 3 page faults when writing back the normalized numbers.
 

Answers and Replies

  • #2
rcgldr
Homework Helper
8,728
545
You'd need 4MB of memory to hold all the data. Unless other processes were consuming nearly all of you computers memory, then none of that 4MB of data would be paged out to the swap file.

Performance issues would be related to the cache size and algorithm implemented on your computer. Dram is normally optimized for sequential access.
 

Related Threads on Virtual Memory Question

Replies
15
Views
839
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
9
Views
3K
  • Last Post
Replies
3
Views
2K
Replies
5
Views
7K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
14
Views
3K
  • Last Post
Replies
5
Views
6K
  • Last Post
Replies
8
Views
4K
  • Last Post
Replies
15
Views
5K
Top