optimal memory layout for read-only/write memory segments.

Posted by aaa on Stack Overflow See other posts from Stack Overflow or by aaa
Published on 2010-04-29T02:01:07Z Indexed on 2010/04/29 2:07 UTC
Read the original article Hit count: 365

hello.

Suppose I have two memory segments (equal size each, approximately 1kb in size) , one is read-only (after initialization), and other is read/write.

what is the best layout in memory for such segments in terms of memory performance? one allocation, contiguous segments or two allocations (in general not contiguous). my primary architecture is linux Intel 64-bit.

my feeling is former (cache friendlier) case is better. is there circumstances, where second layout is preferred?

Thanks

© Stack Overflow or respective owner

Related posts about memory

Related posts about Performance