def _get_widths(jstat_data=None, short_fields=False):
    """Function that returns the recommended field widths of the jstat output"""
    widths = dict()
    for field in jstat_data:
        max_width = max(list(map(len, list(map(str, jstat_data[field])))))
        field_width = len(field)
        if field_width > max_width:
            widths[field] = field_width
        else:
            widths[field] = max_width
    if short_fields:
        survivor_max = 6
        newgen_max = 6
        oldgen_max = 6
    else:
        survivor_max = max(widths['S0C'], widths['S1C'], widths['S0U'],
            widths['S1U'])
        newgen_max = max(widths['EC'], widths['EU'])
        oldgen_max = max(widths['OC'], widths['OU'])
    widths['OC'] = oldgen_max
    widths['OU'] = oldgen_max
    widths['EC'] = newgen_max
    widths['EU'] = newgen_max
    widths['S0C'] = survivor_max
    widths['S1C'] = survivor_max
    widths['S0U'] = survivor_max
    widths['S1U'] = survivor_max
    widths['EP'] = 6
    widths['OP'] = 6
    return widths
