Results 1 to 5 of 5
I am trying for a optimization in my project.For that i want to check heap memory(using malloc) access is faster than shared memory(using shmget) i.e access time of heap memory ...
- 06-21-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 9
Heap V/s Shared memory
I am trying for a optimization in my project.For that i want to check heap memory(using malloc) access is faster than shared memory(using shmget) i.e access time of heap memory < access time of shared memory.
But i found the result opposite. access time of heap (0.00750 ms)>access time of shared memory(0.00450ms)
Can any body give an explanation for that or share some documents stuff for same.
Thnx
- 06-21-2010 #2Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
First off, what's this based on? 0.00750 ms isn't a lot of time. It sounds like you just tested a few accesses - you need to do far, far more than that if you want an accurate result.Code:access time of heap (0.00750 ms)>access time of shared memory(0.00450ms)
I'd be surprised if there's any difference between access to shared memory and access to your heap. You may find that one gets paged out to disk more, and so access is slower, but that will only affect you if you're only accessing it rarely, in which case speed is probably not a factor at all.
Also, are you sure memory access times are really your bottle-neck? Sounds unlikely, but not impossible.
- 06-21-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 9
Thnx John..
It is required in my project..i need to find why the access time of heap memory is slower than shared memory.I have to use this result in my project.
I had coded sample program to check their access times and then give the result on this forum.
I am also shocked when i saw the time.
- 06-21-2010 #4Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
- 06-21-2010 #5
I'm sorry, but homework questions are not allowed on this forum, as per the forum rules:
http://www.linuxforums.org/forum/lin...ums-rules.htmlDISTRO=Arch
Registered Linux User #388732



