Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] How to deal with LargeObjectException in RevWalk.parseCommit?

On 04.04.2012 19:55, Shawn Pearce wrote:
> On Wed, Apr 4, 2012 at 10:48, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
>> One of our users is running into a LargeObjectException$ExceedsLimit for
>> RevWalk.parseCommit. I'm not sure what can make a commit-object itself
>> that large, but I'm wondering if it's reasonable to have a limit here at
>> all?
> ...
>> org.eclipse.jgit.errors.LargeObjectException$ExceedsLimit: Object
>> 8260e144113486b44c81bed39eb10dedd834804c exceeds 5 242 880 limit, actual
>> size is 26 693 640
> 
> Ouch. They have a commit object whose message is ~26 MiB in size? That
> is huge. Or the object information is corrupt.

I'll check that.

>> Personally, I'd prefer to let the application run into an OOME
>> here. Should we make the limit configurable by a system property?
> 
> This is a hard limit in RevWalk right now:
> 
> 	byte[] getCachedBytes(RevObject obj, ObjectLoader ldr)
> 			throws LargeObjectException, MissingObjectException, IOException {
> 		try {
> 			return ldr.getCachedBytes(5 * MB);
> 		} catch (LargeObjectException tooBig) {
> 			tooBig.setObjectId(obj);
> 			throw tooBig;
> 		}
> 	}
> 
> We could make this a repository level configuration setting, with the
> default being the current 5 MiB. If users need it bigger, they could
> set a larger limit in .git/config or ~/.gitconfig.

OK. In addition I'd still add a setter to change the default limit, e.g.
SmartGit usually runs with -Xmx256M, so I'd probably have 128M as
default here. The few remaining users which use their pagefile.sys for
the commit message will have to change their repository configuration.
If there are no objections, I'll prepare a corresponding patch.

--
Best regards,
Marc Strapetz
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


Back to the top