public class Accumulator { private double total: private int N: } public class T
ID: 3883424 • Letter: P
Question
public class Accumulator { private double total: private int N: } public class Transaction { private final String who: private final Date when: private final double amount: } public class FixedCapacityStackOfStrings { private String [] a = new String[C]: // stack entries private int N: // size } class INode implements Comparable { protected byte [] name: protected long modificationTime: protected long accessTime: } class INodeFile extends INode { private long header: private Block [] blocks: } class INodeDirectory extends INode { private INodePile [] children: } public class Block implements Comparable { private long blockId: private long numBytes: private long gcnerationStamp: } Assuming a 64-bit CPU architecture and Java 7, given the class definitions described in Listing 1 compute the amount of memory needed by each of the following objects considering their respective assumptions: 1. INodeFile size is ? (assuming that an inode name consist of 8 chars, and that there are Blocks per INodeFile. Remember to include the amount of memory required to store the Blocks in your calculation) 2. INodeDirectory size is ? (consider the same assumptions from INodeFile, and also assume that there are 10 INodeFiles per INodeDirectory. Remember to include the amount of memory required to store the INodeFiles in your calculation) Please write at least 50 words to explain their sizes. Also: note that in all of your calculations you should assume a 64-bit CPU architecture and Java 7. Don't forget to consider the padding in your calculation.Explanation / Answer
INodeFile:
long: 8bytes
Block[]: 8bytes
housekeeping: 8bytes
padding: 0
total:__24bytes
INodeDirectory:
INodeFile[]:8bytes
housekeeping: 8bytes
total: __16bytes
Here you go champ. I have included 2 answers for you. I hope they will help you. If you have any doubt please feel free to comment below. I shall be glad to help you till the problem gets resolved.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.