In hprof, set string class instance size to that of an empty string.

Bug: 21066704
Change-Id: Ic52193f5801117ca642055ea700fc4bc21b690e8
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc
index d0eb083..868cb23 100644
--- a/runtime/hprof/hprof.cc
+++ b/runtime/hprof/hprof.cc
@@ -981,7 +981,11 @@
     // ClassObjects have their static fields appended, so aren't all the same size.
     // But they're at least this size.
     __ AddU4(sizeof(mirror::Class));  // instance size
-  } else if (klass->IsArrayClass() || klass->IsStringClass() || klass->IsPrimitive()) {
+  } else if (klass->IsStringClass()) {
+    // Strings are variable length with character data at the end like arrays.
+    // This outputs the size of an empty string.
+    __ AddU4(sizeof(mirror::String));
+  } else if (klass->IsArrayClass() || klass->IsPrimitive()) {
     __ AddU4(0);
   } else {
     __ AddU4(klass->GetObjectSize());  // instance size