2841 } else { |
2841 } else { |
2842 return vsm()->allocate(word_size); |
2842 return vsm()->allocate(word_size); |
2843 } |
2843 } |
2844 } |
2844 } |
2845 |
2845 |
|
2846 MetaWord* Metaspace::expand_and_allocate(size_t word_size, MetadataType mdtype) { |
|
2847 MetaWord* result; |
|
2848 MetaspaceGC::set_expand_after_GC(true); |
|
2849 size_t before_inc = MetaspaceGC::capacity_until_GC(); |
|
2850 size_t delta_words = MetaspaceGC::delta_capacity_until_GC(word_size); |
|
2851 MetaspaceGC::inc_capacity_until_GC(delta_words); |
|
2852 if (PrintGCDetails && Verbose) { |
|
2853 gclog_or_tty->print_cr("Increase capacity to GC from " SIZE_FORMAT |
|
2854 " to " SIZE_FORMAT, before_inc, MetaspaceGC::capacity_until_GC()); |
|
2855 } |
|
2856 result = allocate(word_size, mdtype); |
|
2857 |
|
2858 return result; |
|
2859 } |
|
2860 |
2846 // Space allocated in the Metaspace. This may |
2861 // Space allocated in the Metaspace. This may |
2847 // be across several metadata virtual spaces. |
2862 // be across several metadata virtual spaces. |
2848 char* Metaspace::bottom() const { |
2863 char* Metaspace::bottom() const { |
2849 assert(DumpSharedSpaces, "only useful and valid for dumping shared spaces"); |
2864 assert(DumpSharedSpaces, "only useful and valid for dumping shared spaces"); |
2850 return (char*)vsm()->current_chunk()->bottom(); |
2865 return (char*)vsm()->current_chunk()->bottom(); |