[Canonical page](<https://docs.dhtmlx.com/planning-engine/java/api/project-load-profile/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Project#loadProfile

Reads per-bucket load and capacity of resources on the solved baseline of a [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>). Read-only, and needs a solved project. For the load of hypothetical dates, use [`preview`](<https://docs.dhtmlx.com/planning-engine/java/api/project-preview.md>) with a `profile` query instead.

## Signature

```java
public LoadProfile loadProfile(LoadProfileOptions options)
```

Synchronous and CPU-only. Doesn't change the project. Not synchronized: serialize calls on one instance.

## Parameters

| Name | Type | Description |
|---|---|---|
| `options` | [`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile-options.md>) | A [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/profile-query.md>) (range, resources, basis, task lists) and an optional `baselineId` check. Build it with `new LoadProfileOptions(query)`. Must not be `null` |

## Returns

A new [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile.md>) for the baseline dates.

## Errors

All exceptions are unchecked.

| Error | When |
|---|---|
| [`ProjectException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/project-exception.md>) with `code == ProjectError.NO_BASELINE` | The project is unsolved, including after `apply` |
| `ProjectException` with `code == ProjectError.STALE_BASELINE` | `options.baselineId` doesn't name the current baseline |
| [`InputException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/input-exception.md>) | `to <= from`, or more than 100 000 buckets per resource (path `to`); an unknown resource (path `resources`) |
| `NullPointerException` | `options` is `null` |

## Example

Print the overloaded days of a resource that works on two tasks at once.

```java
import java.util.List;
import org.dhtmlx.plen.*;

public class LoadProfileExample {
  public static void main(String[] args) throws Exception {
    ProjectData data = new ProjectData()
        .withTasks(List.of(
            new TaskData(Id.str("a")).withStartDate(Moment.fromYmdHm(2026, 1, 1, 0, 0)).withDuration(2.0),
            new TaskData(Id.str("b")).withStartDate(Moment.fromYmdHm(2026, 1, 2, 0, 0)).withDuration(2.0)))
        .withResources(List.of(new ResourceData().withId(Id.str("dev"))))
        .withAssignments(List.of(
            new AssignmentData().withTask(Id.str("a")).withResource(Id.str("dev")).withValue(1.0),
            new AssignmentData().withTask(Id.str("b")).withResource(Id.str("dev")).withValue(1.0)));
    data.config.useCalendars = false;

    Project project = new Project();
    project.solve(data, new SolveOptions());

    ProfileQuery query = new ProfileQuery(Moment.fromYmdHm(2026, 1, 1, 0, 0), Moment.fromYmdHm(2026, 1, 5, 0, 0));
    LoadProfile profile = project.loadProfile(new LoadProfileOptions(query));
    for (ResourceLoad resource : profile.resources) {
      for (LoadBucket bucket : resource.buckets) {
        if (bucket.load > bucket.capacity) {
          System.out.println(resource.resource + " at " + bucket.start + ": " + bucket.load + " of " + bucket.capacity);
          // dev at 2026-01-02 00:00: 2.0 of 1.0
        }
      }
    }
  }
}
```

## Related

- [`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile-options.md>) - the query and the baseline check
- [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/profile-query.md>) - range, resources, basis and task lists
- [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/java/api/resources/load-profile.md>) - per-bucket load and capacity it returns
- [Resource load](<https://docs.dhtmlx.com/planning-engine/java/resources-and-assignment/resource-load.md>) - querying a profile and capacity modes
