1 package org.apache.lucene.util;
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with this
6 * work for additional information regarding copyright ownership. The ASF
7 * licenses this file to You under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations under
21 * Returns primitive memory sizes for estimating RAM usage.
24 public abstract class MemoryModel {
27 * @return size of array beyond contents
29 public abstract int getArraySize();
32 * @return Class size overhead
34 public abstract int getClassSize();
37 * @param clazz a primitive Class - bool, byte, char, short, long, float,
39 * @return the size in bytes of given primitive Class
41 public abstract int getPrimitiveSize(Class<?> clazz);
44 * @return size of reference
46 public abstract int getReferenceSize();