Exploring Memory Periodicity with Chart Analysis

In summary: This could also be related to the code's use of a large number of memory addresses (n = 10000000) and the fact that it is performing multiple iterations (100) for each step size.
  • #1
Monte_Carlo
72
0
Hi guys,

I've been given the code below and asked to explain the data shown in the attached chart. Any ideas? The data shows periodicity, what could explain it? I know it has to do with memory.

Code:
-------------------------------------------------------
#include <iostream>
#include <fstream>
#include <ctime>
#include <stdlib.h>
#include <math.h>
#include <windows.h>
#include <memory.h>

static LARGE_INTEGER liStart;
static LARGE_INTEGER liStop;

using namespace std; 

int main(){
	int n = 10000000; 
	
	int k = 0; 
	ofstream outFile ("out.txt"); 
	for (int stepSize = 0; stepSize < 100000; stepSize += 128){
		int * a = new int[n]; 
		int x = 0; 
		
		for (int i = 0; i < n; i += 4096){
			x += a[i+32]; 
		}
			
		QueryPerformanceCounter(&liStart); 
		x=0;		
		for (int i = 0; i < 100; i++){
			x += a[i * stepSize]; 
		}
		QueryPerformanceCounter(&liStop); 		
		outFile << stepSize << '\t' << liStop.QuadPart - liStart.QuadPart<<endl;; 
		outFile.flush();
		delete [] a; 
	}
	
	return(0); 
}

-------------------------------------------------------

Thanks,

Monte
 

Attachments

  • chart.jpg
    chart.jpg
    14 KB · Views: 465
Last edited by a moderator:
Physics news on Phys.org
  • #2
The data shows how quickly the code is able to access memory as the step size (the distance between two consecutive memory addresses read by the code) increases. The periodicity of the data indicates that the code is accessing memory in a predictable manner, most likely due to the use of caching technology. As the step size increases, it becomes more difficult for the caching technology to predict which memory locations will be accessed and therefore the performance decreases.
 

1. What is memory periodicity?

Memory periodicity is the phenomenon where memories are stored and retrieved in a cyclical pattern. This means that certain memories are more likely to be remembered at certain times, such as on specific dates or during certain events.

2. How is chart analysis used to explore memory periodicity?

Chart analysis involves creating visual representations, such as graphs or charts, of data related to memory patterns. This can include the frequency of certain memories being recalled, the timing of these memories, and any correlations with external factors. By analyzing these charts, researchers can gain insights into memory periodicity.

3. What factors can influence memory periodicity?

There are several factors that can influence memory periodicity, including environmental cues, emotions, and personal experiences. For example, memories may be more likely to resurface during a certain season or while listening to a specific song. Additionally, the intensity of the emotions associated with a memory can also affect its periodicity.

4. What are the implications of studying memory periodicity?

Understanding memory periodicity can have practical applications in fields such as education and therapy. By identifying patterns in memory recall, educators can design learning activities that align with these patterns to optimize retention. In therapy, recognizing memory periodicity can aid in the treatment of conditions such as PTSD or anxiety.

5. Are there any limitations to exploring memory periodicity with chart analysis?

While chart analysis can provide valuable insights into memory periodicity, it is important to note that it is not the only method of studying this phenomenon. Additionally, the accuracy of chart analysis can be influenced by the quality of the data collected, as well as any biases or assumptions made during the analysis process. Further research and diverse methods of exploration are necessary for a comprehensive understanding of memory periodicity.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
0
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Differential Equations
Replies
2
Views
7K
Replies
2
Views
5K
Back
Top