code: private static DMatrix dense(Chunk[] chunks, int weight, DataInfo di, int respIdx, float[] resp, float[] weights) throws XGBoostError {
          Log.debug("Treating matrix as dense.");
          BigDenseMatrix data = null;
          try {
              data = allocateDenseMatrix(chunks[0].len(), di);
              long actualRows = denseChunk(data, chunks, weight, respIdx, di, resp, weights);
              assert actualRows == data.nrow;
              return new DMatrix(data, Float.NaN);
          } finally {
              if (data != null) {
                  data.dispose();
              }
          }
      }
docs: **************************************************************************************************************
  ************************************* DMatrix creation for dense matrices *************************************
  **************************************************************************************************************