Description
Could be related to https://issues.apache.org/jira/browse/ANY23-386 as the OutOfMemoryError is not present using the version 2.1.
With the following snippet of HTML as input:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div itemscope itemtype='http://schema.org/Product'> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"> <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"><div itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review"/></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span> </div> </body> </html>
Calling `toJson` on the retrieved ItemScope will crash the JVM with an `OutOfMemoryError`